{"record":{"id":"14f1303873203a17","repo":"flowable/flowable-engine","slug":"tenantidlike-is-null","errorCode":null,"errorMessage":"tenantIdLike is null","messagePattern":"tenantIdLike is null","errorType":"validation","errorClass":"FlowableIllegalArgumentException","httpStatus":null,"severity":"error","filePath":"modules/flowable-batch-service/src/main/java/org/flowable/batch/service/impl/BatchPartQueryImpl.java","lineNumber":184,"sourceCode":"            throw new FlowableIllegalArgumentException(\"scopeType is null\");\n        }\n        this.scopeType = scopeType;\n        return this;\n    }\n\n    @Override\n    public BatchPartQuery tenantId(String tenantId) {\n        if (tenantId == null) {\n            throw new FlowableIllegalArgumentException(\"tenantId is null\");\n        }\n        this.tenantId = tenantId;\n        return this;\n    }\n\n    @Override\n    public BatchPartQuery tenantIdLike(String tenantIdLike) {\n        if (tenantIdLike == null) {\n            throw new FlowableIllegalArgumentException(\"tenantIdLike is null\");\n        }\n        this.tenantIdLike = tenantIdLike;\n        return this;\n    }\n\n    @Override\n    public BatchPartQuery withoutTenantId() {\n        this.withoutTenantId = true;\n        return this;\n    }\n\n    @Override\n    public BatchPartQuery completed() {\n        this.completed = true;\n        return this;\n    }\n\n    @Override","sourceCodeStart":166,"sourceCodeEnd":202,"githubUrl":"https://github.com/flowable/flowable-engine/blob/d6d39ce1c69ff244f2d9dc6af756a9b95e865586/modules/flowable-batch-service/src/main/java/org/flowable/batch/service/impl/BatchPartQueryImpl.java#L166-L202","documentation":"BatchPartQueryImpl.tenantIdLike() throws FlowableIllegalArgumentException when the tenantIdLike argument is null. The like-filter value must be a non-null SQL LIKE pattern; null is rejected at setter time instead of being turned into invalid SQL.","triggerScenarios":"Calling batchPartQuery().tenantIdLike(null), or building a pattern via String concatenation where the prefix variable is null.","commonSituations":"Dynamic tenant-prefix searches where the prefix configuration is missing; string patterns assembled from null user input.","solutions":["Pass a non-null LIKE pattern, e.g. \"myTenant%\"","Skip .tenantIdLike(...) when no like-filter is desired","Ensure the pattern source (config/input) is validated before building the query"],"exampleFix":"// before\nquery.tenantIdLike(prefix + \"%\"); // prefix may be null -> \"null%\"\n// after\nif (prefix != null) {\n    query.tenantIdLike(prefix + \"%\");\n}","handlingStrategy":"validation","validationCode":"if (tenantIdLike == null) {\n    throw new IllegalArgumentException(\"tenantIdLike pattern must be non-null\");\n}\nquery.tenantIdLike(tenantIdLike);","typeGuard":"boolean hasLikePattern(String p) { return p != null && !p.isEmpty(); }","tryCatchPattern":"try {\n    query.tenantIdLike(pattern);\n} catch (FlowableIllegalArgumentException e) {\n    logger.warn(\"tenantIdLike pattern was null; using unfiltered query\");\n}","preventionTips":["Build LIKE patterns from validated non-null prefixes","Remember String concat with null yields \"null\" — check before concatenating","Omit the like-filter when no pattern is configured"],"tags":["java","flowable","null-check","query-api"],"backgroundTag":"null-argument","analyzedSha":"d6d39ce1c69ff244f2d9dc6af756a9b95e865586","analyzedAt":"2026-09-11T06:41:19.413Z","contentChangedAt":"2026-09-11T06:41:19.413Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}