{"record":{"id":"f97690a755c72cd8","repo":"hibernate/hibernate-orm","slug":"generated-column-values-were-not-provided-for-comp-f97690","errorCode":null,"errorMessage":"Generated column values were not provided for composite attribute: {}.{}","messagePattern":"Generated column values were not provided for composite attribute: (.+?)\\.(.+?)","errorType":"exception","errorClass":"CompositeValueGenerationException","httpStatus":null,"severity":"error","filePath":"hibernate-core/src/main/java/org/hibernate/generator/internal/CompositeGeneratorBuilder.java","lineNumber":134,"sourceCode":"\t\t\t}\n\t\t\tif ( generator instanceof OnExecutionGenerator onExecutionGenerator\n\t\t\t\t\t&& generator.generatedOnExecution() ) {\n\t\t\t\tfinal var generatorEventTypes = generator.getEventTypes();\n\t\t\t\tfor ( var eventType : eventTypes ) {\n\t\t\t\t\tfinal var details = columnValueDetailsByEvent.get( eventType );\n\t\t\t\t\tif ( details != null ) {\n\t\t\t\t\t\tif ( generatorEventTypes.contains( eventType ) ) {\n\t\t\t\t\t\t\tif ( !onExecutionGenerator.referenceColumnsInSql( dialect, eventType ) ) {\n\t\t\t\t\t\t\t\tdetails.excludeColumns( columnIndex, span );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if ( onExecutionGenerator.writePropertyValue( eventType ) ) {\n\t\t\t\t\t\t\t\t// leave the default parameter marker values in place\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tfinal String[] referencedColumnValues =\n\t\t\t\t\t\t\t\t\t\tonExecutionGenerator.getReferencedColumnValues( dialect, eventType );\n\t\t\t\t\t\t\t\tif ( referencedColumnValues == null ) {\n\t\t\t\t\t\t\t\t\tthrow new CompositeValueGenerationException(\n\t\t\t\t\t\t\t\t\t\t\t\"Generated column values were not provided for composite attribute: \"\n\t\t\t\t\t\t\t\t\t\t\t+ mappingProperty.getName() + '.' + property.getName()\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif ( referencedColumnValues.length != span ) {\n\t\t\t\t\t\t\t\t\tthrow new CompositeValueGenerationException(\n\t\t\t\t\t\t\t\t\t\t\t\"Mismatch between number of collected generated column values and number of columns for composite attribute: \"\n\t\t\t\t\t\t\t\t\t\t\t+ mappingProperty.getName() + '.' + property.getName()\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdetails.setColumnValues( columnIndex, referencedColumnValues );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if ( !onExecutionGenerator.allowMutation() ) {\n\t\t\t\t\t\t\tdetails.excludeColumns( columnIndex, span );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/hibernate/hibernate-orm/blob/fad1729dce015f908198d57a8d80274a30f905a5/hibernate-core/src/main/java/org/hibernate/generator/internal/CompositeGeneratorBuilder.java#L116-L152","documentation":"Error \"Generated column values were not provided for composite attribute: {}.{}\" thrown in hibernate/hibernate-orm.","triggerScenarios":"Thrown when a composite attribute with generated columns receives no generated values from the database.","commonSituations":"Typical situations: the driver/database not returning generated values for all columns of the composite; partial generation metadata in the mapping.","solutions":["Ensure every generated column of the composite attribute has @Generated or a matching generator so values are produced.","Check the composite attribute mapping so that the set of generated columns matches what the generator provides."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fad1729dce015f908198d57a8d80274a30f905a5","analyzedAt":"2026-08-22T04:13:57.527Z","schemaVersion":2},"datasetVersion":"2026-08-22T09:17:25.309Z"}