diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/AnnotatedColumn.java b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/AnnotatedColumn.java index 7c1e5bcff62d..bade05554c3d 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/AnnotatedColumn.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/AnnotatedColumn.java @@ -20,9 +20,9 @@ import org.hibernate.boot.model.naming.ImplicitBasicColumnNameSource; import org.hibernate.boot.model.naming.ImplicitNamingStrategy; import org.hibernate.boot.model.naming.ObjectNameNormalizer; +import org.hibernate.boot.model.naming.PhysicalNamingStrategy; import org.hibernate.boot.model.relational.Database; import org.hibernate.boot.model.source.spi.AttributePath; -import org.hibernate.boot.spi.InFlightMetadataCollector; import org.hibernate.boot.spi.MetadataBuildingContext; import org.hibernate.boot.spi.PropertyData; import org.hibernate.internal.CoreMessageLogger; @@ -299,7 +299,8 @@ protected void initMappingColumn( else { mappingColumn = new Column(); mappingColumn.setExplicit( !isImplicit ); - redefineColumnName( columnName, propertyName, applyNamingStrategy ); + final boolean nameDetermined = + inferColumnNameIfPossible( columnName, propertyName, applyNamingStrategy ); mappingColumn.setLength( length ); if ( precision != null && precision > 0 ) { //relevant precision mappingColumn.setPrecision( precision ); @@ -311,7 +312,12 @@ protected void initMappingColumn( mappingColumn.setArrayLength( arrayLength ); mappingColumn.setNullable( nullable ); mappingColumn.setSqlType( sqlType ); - if ( unique ) { + mappingColumn.setUnique( unique ); + // if the column name is not determined, we will assign the + // name to the unique key later this method gets called again + // from linkValueUsingDefaultColumnNaming() in second pass + if ( unique && nameDetermined ) { + // assign a unique key name to the column getParent().getTable().createUniqueKey( mappingColumn, getBuildingContext() ); } for ( CheckConstraint constraint : checkConstraints ) { @@ -341,20 +347,29 @@ public boolean isNameDeferred() { return mappingColumn == null || isEmpty( mappingColumn.getName() ); } - public void redefineColumnName(String columnName, String propertyName, boolean applyNamingStrategy) { - if ( StringHelper.isEmpty( columnName ) && StringHelper.isEmpty( propertyName ) ) { - // nothing to do - return; + /** + * Attempt to infer the column name from the explicit {@code name} given by the annotation and the property or field + * name. In the case of a {@link jakarta.persistence.JoinColumn}, this is impossible, due to the rules implemented in + * {@link org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl#determineJoinColumnName}. In cases + * where the column name cannot be inferred, the {@link Column} is not assigned a name, and this method returns + * {@code false}. The "dummy" {@code Column} will later be replaced with a {@code Column} with a name determined by + * the {@link ImplicitNamingStrategy} when {@link AnnotatedJoinColumn#linkValueUsingDefaultColumnNaming} is called + * during a {@link org.hibernate.boot.spi.SecondPass}. + * @return {@code true} if a name could be inferred + */ + boolean inferColumnNameIfPossible(String columnName, String propertyName, boolean applyNamingStrategy) { + if ( !isEmpty( columnName ) || !isEmpty( propertyName ) ) { + final String logicalColumnName = resolveLogicalColumnName( columnName, propertyName ); + mappingColumn.setName( processColumnName( logicalColumnName, applyNamingStrategy ) ); + return true; + } + else { + return false; } - final String logicalColumnName = resolveLogicalColumnName( columnName, propertyName ); - mappingColumn.setName( processColumnName( logicalColumnName, applyNamingStrategy ) ); } private String resolveLogicalColumnName(String columnName, String propertyName) { - final String baseColumnName = StringHelper.isNotEmpty( columnName ) - ? columnName - : inferColumnName( propertyName ); - + final String baseColumnName = isNotEmpty( columnName ) ? columnName : inferColumnName( propertyName ); if ( parent.getPropertyHolder() != null && parent.getPropertyHolder().isComponent() ) { // see if we need to apply one-or-more @EmbeddedColumnNaming patterns return applyEmbeddedColumnNaming( baseColumnName, (ComponentPropertyHolder) parent.getPropertyHolder() ); @@ -370,7 +385,7 @@ private String applyEmbeddedColumnNaming(String inferredColumnName, ComponentPro boolean appliedAnyPatterns = false; final String columnNamingPattern = propertyHolder.getComponent().getColumnNamingPattern(); - if ( StringHelper.isNotEmpty( columnNamingPattern ) ) { + if ( isNotEmpty( columnNamingPattern ) ) { // zip_code result = String.format( columnNamingPattern, result ); appliedAnyPatterns = true; @@ -380,7 +395,7 @@ private String applyEmbeddedColumnNaming(String inferredColumnName, ComponentPro while ( tester.parent.isComponent() ) { final ComponentPropertyHolder parentHolder = (ComponentPropertyHolder) tester.parent; final String parentColumnNamingPattern = parentHolder.getComponent().getColumnNamingPattern(); - if ( StringHelper.isNotEmpty( parentColumnNamingPattern ) ) { + if ( isNotEmpty( parentColumnNamingPattern ) ) { // home_zip_code result = String.format( parentColumnNamingPattern, result ); appliedAnyPatterns = true; @@ -398,24 +413,19 @@ private String applyEmbeddedColumnNaming(String inferredColumnName, ComponentPro protected String processColumnName(String columnName, boolean applyNamingStrategy) { if ( applyNamingStrategy ) { - final Database database = getBuildingContext().getMetadataCollector().getDatabase(); - return getBuildingContext().getBuildingOptions().getPhysicalNamingStrategy() + final Database database = getDatabase(); + return getPhysicalNamingStrategy() .toPhysicalColumnName( database.toIdentifier( columnName ), database.getJdbcEnvironment() ) .render( database.getDialect() ); } else { - return getBuildingContext().getObjectNameNormalizer().toDatabaseIdentifierText( columnName ); + return getObjectNameNormalizer().toDatabaseIdentifierText( columnName ); } - } protected String inferColumnName(String propertyName) { - final Database database = getBuildingContext().getMetadataCollector().getDatabase(); - final ObjectNameNormalizer normalizer = getBuildingContext().getObjectNameNormalizer(); - final ImplicitNamingStrategy implicitNamingStrategy = getBuildingContext().getBuildingOptions().getImplicitNamingStrategy(); - - Identifier implicitName = normalizer.normalizeIdentifierQuoting( - implicitNamingStrategy.determineBasicColumnName( + Identifier implicitName = getObjectNameNormalizer().normalizeIdentifierQuoting( + getImplicitNamingStrategy().determineBasicColumnName( new ImplicitBasicColumnNameSource() { final AttributePath attributePath = AttributePath.parse( propertyName ); @@ -448,11 +458,28 @@ public MetadataBuildingContext getBuildingContext() { ); } - return getBuildingContext().getBuildingOptions().getPhysicalNamingStrategy() + final Database database = getDatabase(); + return getPhysicalNamingStrategy() .toPhysicalColumnName( implicitName, database.getJdbcEnvironment() ) .render( database.getDialect() ); } + private ObjectNameNormalizer getObjectNameNormalizer() { + return getBuildingContext().getObjectNameNormalizer(); + } + + private Database getDatabase() { + return getBuildingContext().getMetadataCollector().getDatabase(); + } + + private PhysicalNamingStrategy getPhysicalNamingStrategy() { + return getBuildingContext().getBuildingOptions().getPhysicalNamingStrategy(); + } + + private ImplicitNamingStrategy getImplicitNamingStrategy() { + return getBuildingContext().getBuildingOptions().getImplicitNamingStrategy(); + } + public String getName() { return mappingColumn.getName(); } @@ -503,14 +530,12 @@ public void linkWithValue(SimpleValue value) { protected void addColumnBinding(SimpleValue value) { final String logicalColumnName; - final MetadataBuildingContext context = getBuildingContext(); - final InFlightMetadataCollector collector = context.getMetadataCollector(); if ( isNotEmpty( this.logicalColumnName ) ) { logicalColumnName = this.logicalColumnName; } else { - final Identifier implicitName = context.getObjectNameNormalizer().normalizeIdentifierQuoting( - context.getBuildingOptions().getImplicitNamingStrategy().determineBasicColumnName( + final Identifier implicitName = getObjectNameNormalizer().normalizeIdentifierQuoting( + getImplicitNamingStrategy().determineBasicColumnName( new ImplicitBasicColumnNameSource() { @Override public AttributePath getAttributePath() { @@ -524,14 +549,15 @@ public boolean isCollectionElement() { @Override public MetadataBuildingContext getBuildingContext() { - return context; + return AnnotatedColumn.this.getBuildingContext(); } } ) ); - logicalColumnName = implicitName.render( collector.getDatabase().getDialect() ); + logicalColumnName = implicitName.render( getDatabase().getDialect() ); } - collector.addColumnNameBinding( value.getTable(), logicalColumnName, getMappingColumn() ); + getBuildingContext().getMetadataCollector() + .addColumnNameBinding( value.getTable(), logicalColumnName, getMappingColumn() ); } public void forceNotNull() { diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/AnnotatedJoinColumn.java b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/AnnotatedJoinColumn.java index aa7ab43990ac..53dbb811e5de 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/AnnotatedJoinColumn.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/AnnotatedJoinColumn.java @@ -8,12 +8,12 @@ import org.hibernate.AssertionFailure; import org.hibernate.annotations.JoinFormula; import org.hibernate.boot.model.naming.Identifier; +import org.hibernate.boot.model.naming.ImplicitNamingStrategy; import org.hibernate.boot.model.naming.ObjectNameNormalizer; import org.hibernate.boot.model.relational.Database; import org.hibernate.boot.spi.InFlightMetadataCollector; import org.hibernate.boot.spi.MetadataBuildingContext; import org.hibernate.boot.spi.PropertyData; -import org.hibernate.internal.util.StringHelper; import org.hibernate.mapping.Column; import org.hibernate.mapping.PersistentClass; import org.hibernate.mapping.SimpleValue; @@ -313,6 +313,11 @@ public void copyReferencedStructureAndCreateDefaultJoinColumns( setMappingColumn( null ); } + /** + * The JPA-specified rules implemented in + * {@link org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl#determineJoinColumnName} + * prevent us from assigning defaulted names to {@link JoinColumn} until the second pass. + */ public void linkValueUsingDefaultColumnNaming( Column referencedColumn, PersistentClass referencedEntity, @@ -326,11 +331,15 @@ public void linkValueUsingDefaultColumnNaming( Column referencedColumn, PersistentClass referencedEntity, SimpleValue value) { + // In the case of a reference to a composite primary key, + // this instance of AnnotatedJoinColumn actually represents + // multiple foreign key columns, and this method will be + // called multiple times on the same instance final String logicalReferencedColumn = getBuildingContext().getMetadataCollector() .getLogicalColumnName( referencedEntity.getTable(), referencedColumn.getQuotedName() ); final String columnName = defaultColumnName( columnIndex, referencedEntity, logicalReferencedColumn ); - //yuk side effect on an implicit column + // awful side effect on an implicit column setLogicalColumnName( columnName ); setImplicit( true ); setReferencedColumn( logicalReferencedColumn ); @@ -451,10 +460,23 @@ public void overrideFromReferencedColumnIfNecessary(Column column) { } } + /** + * Assign the column name from the explicit {@code name} given by the annotation, if any. In cases where the column + * name cannot be inferred, the {@link Column} is not assigned a name, and this method returns {@code false}. The + * "dummy" {@code Column} will later be replaced with a {@code Column} with name determined by the rules implemented + * in {@link org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl#determineJoinColumnName}, + * as required by the JPA specification, or by any other custom {@link ImplicitNamingStrategy} when + * {@link #linkValueUsingDefaultColumnNaming} is called during a {@link org.hibernate.boot.spi.SecondPass}. + * @return {@code true} if a name could be inferred + */ @Override - public void redefineColumnName(String columnName, String propertyName, boolean applyNamingStrategy) { - if ( StringHelper.isNotEmpty( columnName ) ) { + boolean inferColumnNameIfPossible(String columnName, String propertyName, boolean applyNamingStrategy) { + if ( isNotEmpty( columnName ) ) { getMappingColumn().setName( processColumnName( columnName, applyNamingStrategy ) ); + return true; + } + else { + return false; } } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/TableBinder.java b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/TableBinder.java index f55ae2352699..9c54b2022cfe 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/TableBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/TableBinder.java @@ -759,12 +759,13 @@ private static void bindImplicitColumns( PersistentClass referencedEntity, AnnotatedJoinColumns joinColumns, SimpleValue value) { - final KeyValue keyValue = referencedEntity instanceof JoinedSubclass - ? referencedEntity.getKey() - : referencedEntity.getIdentifier(); - final List idColumns = keyValue.getColumns(); - for ( int i = 0; i < idColumns.size(); i++ ) { - final Column column = idColumns.get(i); + final KeyValue keyValue = + referencedEntity instanceof JoinedSubclass + ? referencedEntity.getKey() // a joined subclass is referenced via the key of the subclass table + : referencedEntity.getIdentifier(); + final List referencedKeyColumns = keyValue.getColumns(); + for ( int i = 0; i < referencedKeyColumns.size(); i++ ) { + final Column column = referencedKeyColumns.get(i); final AnnotatedJoinColumn firstColumn = joinColumns.getJoinColumns().get(0); firstColumn.linkValueUsingDefaultColumnNaming( i, column, referencedEntity, value ); firstColumn.overrideFromReferencedColumnIfNecessary( column ); diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/ImplicitNamingStrategyJpaCompliantImpl.java b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/ImplicitNamingStrategyJpaCompliantImpl.java index a97e5076c9a6..e49c25c7e80b 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/ImplicitNamingStrategyJpaCompliantImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/ImplicitNamingStrategyJpaCompliantImpl.java @@ -19,7 +19,7 @@ * preferring to conform to JPA standards. *

* For the legacy JPA-based naming standards initially implemented by Hibernate, - * see/use {@link ImplicitNamingStrategyLegacyJpaImpl} + * see/use {@link ImplicitNamingStrategyLegacyJpaImpl}. * * @author Steve Ebersole */ @@ -31,55 +31,50 @@ public ImplicitNamingStrategyJpaCompliantImpl() { @Override public Identifier determinePrimaryTableName(ImplicitEntityNameSource source) { - if ( source == null ) { - // should never happen, but to be defensive... - throw new HibernateException( "Entity naming information was not provided." ); - } - + assert source != null; final String tableName = transformEntityName( source.getEntityNaming() ); - if ( tableName == null ) { - // todo : add info to error message - but how to know what to write since we failed to interpret the naming source - throw new HibernateException( "Could not determine primary table name for entity" ); + throw new HibernateException( "Could not determine primary table name for entity: " + + source.getEntityNaming().getClassName() ); } - return toIdentifier( tableName, source.getBuildingContext() ); } protected String transformEntityName(EntityNaming entityNaming) { - // prefer the JPA entity name, if specified... - if ( isNotEmpty( entityNaming.getJpaEntityName() ) ) { - return entityNaming.getJpaEntityName(); - } - else { - // otherwise, use the Hibernate entity name - return unqualify( entityNaming.getEntityName() ); - } + return isNotEmpty( entityNaming.getJpaEntityName() ) + // prefer the JPA entity name, if specified + ? entityNaming.getJpaEntityName() + // otherwise, use the unqualified Hibernate entity name + : unqualify( entityNaming.getEntityName() ); } + /** + * JPA states we should use the following as default: + *

The concatenated names of the two associated primary entity + * tables (owning side first), separated by an underscore.
+ * That is: + *
{OWNING SIDE PRIMARY TABLE NAME}_{NON-OWNING SIDE PRIMARY TABLE NAME}
+ */ @Override public Identifier determineJoinTableName(ImplicitJoinTableNameSource source) { - // JPA states we should use the following as default: - // "The concatenated names of the two associated primary entity tables (owning side - // first), separated by an underscore." - // aka: - // {OWNING SIDE PRIMARY TABLE NAME}_{NON-OWNING SIDE PRIMARY TABLE NAME} final String name = source.getOwningPhysicalTableName() + '_' + source.getNonOwningPhysicalTableName(); return toIdentifier( name, source.getBuildingContext() ); } - + /** + * JPA states we should use the following as default: + *
The concatenation of the name of the containing entity and the + * name of the collection attribute, separated by an underscore.
+ * That is, if owning entity has a JPA entity name: + *
{OWNER JPA ENTITY NAME}_{COLLECTION ATTRIBUTE NAME}
+ * otherwise: + *
{OWNER ENTITY NAME}_{COLLECTION ATTRIBUTE NAME}
+ */ @Override public Identifier determineCollectionTableName(ImplicitCollectionTableNameSource source) { - // JPA states we should use the following as default: - // "The concatenation of the name of the containing entity and the name of the - // collection attribute, separated by an underscore. - // aka: - // if owning entity has a JPA entity name: {OWNER JPA ENTITY NAME}_{COLLECTION ATTRIBUTE NAME} - // otherwise: {OWNER ENTITY NAME}_{COLLECTION ATTRIBUTE NAME} final String name = transformEntityName( source.getOwningEntityNaming() ) + '_' + transformAttributePath( source.getOwningAttributePath() ); @@ -111,51 +106,47 @@ public Identifier determineTenantIdColumnName(ImplicitTenantIdColumnNameSource s ); } + /** + * JPA states we should use the following as default: + *
The property or field name
+ * That is, the unqualified attribute path. + */ @Override public Identifier determineBasicColumnName(ImplicitBasicColumnNameSource source) { - // JPA states we should use the following as default: - // "The property or field name" - // aka: - // The unqualified attribute path. return toIdentifier( transformAttributePath( source.getAttributePath() ), source.getBuildingContext() ); } + /** + * JPA states we should use the following as default: + * + */ @Override public Identifier determineJoinColumnName(ImplicitJoinColumnNameSource source) { - // JPA states we should use the following as default: - // - // (1) if there is a "referencing relationship property": - // "The concatenation of the following: the name of the referencing relationship - // property or field of the referencing entity or embeddable class; "_"; the - // name of the referenced primary key column." - // - // (2) if there is no such "referencing relationship property", or if the association is - // an element collection: - // "The concatenation of the following: the name of the entity; "_"; the name of the - // referenced primary key column" - - // todo : we need to better account for "referencing relationship property" - + // TODO: we need to better account for "referencing relationship property" + final String referencingPropertyOrEntity = + source.getNature() == ELEMENT_COLLECTION || source.getAttributePath() == null + ? transformEntityName( source.getEntityNaming() ) + : transformAttributePath( source.getAttributePath() ); final String referencedColumnName = source.getReferencedColumnName().getText(); - - final String name; - if ( source.getNature() == ELEMENT_COLLECTION - || source.getAttributePath() == null ) { - name = transformEntityName( source.getEntityNaming() ) - + '_' + referencedColumnName; - } - else { - name = transformAttributePath( source.getAttributePath() ) - + '_' + referencedColumnName; - } - + final String name = referencingPropertyOrEntity + '_' + referencedColumnName; return toIdentifier( name, source.getBuildingContext() ); } + /** + * JPA states we should use the following as default: + *
the same name as the primary key column [of the referenced table]
+ */ @Override public Identifier determinePrimaryKeyJoinColumnName(ImplicitPrimaryKeyJoinColumnNameSource source) { - // JPA states we should use the following as default: - // "the same name as the primary key column [of the referenced table]" return source.getReferencedPrimaryKeyColumnName(); } diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/NamingHelper.java b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/NamingHelper.java index ece2852b4afe..e1e515d89f6c 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/NamingHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/NamingHelper.java @@ -68,7 +68,7 @@ public String generateHashedFkName( Identifier... columnNames) { // Use a concatenation that guarantees uniqueness, even if identical // names exist between all table and column identifiers. - final StringBuilder sb = new StringBuilder() + final StringBuilder text = new StringBuilder() .append( "table`" ).append( tableName ).append( "`" ) .append( "references`" ).append( referencedTableName ).append( "`" ); // Ensure a consistent ordering of columns, regardless of the order @@ -78,9 +78,10 @@ public String generateHashedFkName( final Identifier[] alphabeticalColumns = columnNames.clone(); Arrays.sort( alphabeticalColumns, comparing( Identifier::getCanonicalName ) ); for ( Identifier columnName : alphabeticalColumns ) { - sb.append( "column`" ).append( columnName ).append( "`" ); + assert columnName != null; + text.append( "column`" ).append( columnName ).append( "`" ); } - return prefix + hashedName( sb.toString() ); + return prefix + hashedName( text.toString() ); } /** @@ -93,7 +94,7 @@ public String generateHashedConstraintName( String prefix, Identifier tableName, Identifier... columnNames ) { // Use a concatenation that guarantees uniqueness, even if identical // names exist between all table and column identifiers. - final StringBuilder sb = new StringBuilder( "table`" + tableName + "`" ); + final StringBuilder text = new StringBuilder( "table`" + tableName + "`" ); // Ensure a consistent ordering of columns, regardless of the order // they were bound. // Clone the list, as sometimes a set of order-dependent Column @@ -101,9 +102,10 @@ public String generateHashedConstraintName( final Identifier[] alphabeticalColumns = columnNames.clone(); Arrays.sort( alphabeticalColumns, comparing(Identifier::getCanonicalName) ); for ( Identifier columnName : alphabeticalColumns ) { - sb.append( "column`" ).append( columnName ).append( "`" ); + assert columnName != null; + text.append( "column`" ).append( columnName ).append( "`" ); } - return prefix + hashedName( sb.toString() ); + return prefix + hashedName( text.toString() ); } /** diff --git a/hibernate-core/src/main/java/org/hibernate/mapping/Table.java b/hibernate-core/src/main/java/org/hibernate/mapping/Table.java index cce046778f3f..a7417a2ae785 100644 --- a/hibernate-core/src/main/java/org/hibernate/mapping/Table.java +++ b/hibernate-core/src/main/java/org/hibernate/mapping/Table.java @@ -469,7 +469,7 @@ public Index getIndex(String indexName) { } public Index addIndex(Index index) { - Index current = indexes.get( index.getName() ); + final Index current = indexes.get( index.getName() ); if ( current != null ) { throw new MappingException( "Index " + index.getName() + " already exists" ); } @@ -478,7 +478,7 @@ public Index addIndex(Index index) { } public UniqueKey addUniqueKey(UniqueKey uniqueKey) { - UniqueKey current = uniqueKeys.get( uniqueKey.getName() ); + final UniqueKey current = uniqueKeys.get( uniqueKey.getName() ); if ( current != null ) { throw new MappingException( "UniqueKey " + uniqueKey.getName() + " already exists" ); } @@ -487,7 +487,9 @@ public UniqueKey addUniqueKey(UniqueKey uniqueKey) { } /** - * Mark the given column unique. + * Mark the given column unique and assign a name to the unique key. + *

+ * This method does not add a {@link UniqueKey} to the table itself! */ public void createUniqueKey(Column column, MetadataBuildingContext context) { final String keyName = context.getBuildingOptions().getImplicitNamingStrategy() diff --git a/hibernate-core/src/main/java/org/hibernate/query/sql/spi/SelectInterpretationsKey.java b/hibernate-core/src/main/java/org/hibernate/query/sql/spi/SelectInterpretationsKey.java index 0adabbd2a761..77be9276835b 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/sql/spi/SelectInterpretationsKey.java +++ b/hibernate-core/src/main/java/org/hibernate/query/sql/spi/SelectInterpretationsKey.java @@ -20,16 +20,16 @@ public class SelectInterpretationsKey implements QueryInterpretationCache.Key { private final String sql; private final JdbcValuesMappingProducer jdbcValuesMappingProducer; private final Collection querySpaces; - private final TupleTransformer tupleTransformer; - private final ResultListTransformer resultListTransformer; + private final TupleTransformer tupleTransformer; + private final ResultListTransformer resultListTransformer; private final int hash; public SelectInterpretationsKey( String sql, JdbcValuesMappingProducer jdbcValuesMappingProducer, Collection querySpaces, - TupleTransformer tupleTransformer, - ResultListTransformer resultListTransformer) { + TupleTransformer tupleTransformer, + ResultListTransformer resultListTransformer) { this.sql = sql; this.jdbcValuesMappingProducer = jdbcValuesMappingProducer; this.querySpaces = querySpaces; @@ -42,8 +42,8 @@ private SelectInterpretationsKey( String sql, JdbcValuesMappingProducer jdbcValuesMappingProducer, Collection querySpaces, - TupleTransformer tupleTransformer, - ResultListTransformer resultListTransformer, + TupleTransformer tupleTransformer, + ResultListTransformer resultListTransformer, int hash) { this.sql = sql; this.jdbcValuesMappingProducer = jdbcValuesMappingProducer; diff --git a/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/StandardSequenceExporter.java b/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/StandardSequenceExporter.java index 5bfeae33ba9d..b2255b6c1230 100644 --- a/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/StandardSequenceExporter.java +++ b/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/StandardSequenceExporter.java @@ -15,6 +15,8 @@ * An {@link Exporter} for {@linkplain Sequence sequences}. * * @author Steve Ebersole + * + * @see org.hibernate.dialect.sequence.SequenceSupport */ public class StandardSequenceExporter implements Exporter { private final Dialect dialect; diff --git a/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/StandardUniqueKeyExporter.java b/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/StandardUniqueKeyExporter.java index 2adb08344b72..a963038901f0 100644 --- a/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/StandardUniqueKeyExporter.java +++ b/hibernate-core/src/main/java/org/hibernate/tool/schema/internal/StandardUniqueKeyExporter.java @@ -14,6 +14,8 @@ * An {@link Exporter} for {@linkplain UniqueKey unique constraints}. * * @author Brett Meyer + * + * @see org.hibernate.dialect.unique.UniqueDelegate */ public class StandardUniqueKeyExporter implements Exporter { private final Dialect dialect; diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/namingstrategy/DummyNamingStrategy.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/namingstrategy/DummyNamingStrategy.java index f9123f071c0c..8c54e9def93e 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/namingstrategy/DummyNamingStrategy.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/namingstrategy/DummyNamingStrategy.java @@ -8,7 +8,6 @@ import org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl; import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment; -@SuppressWarnings("serial") public class DummyNamingStrategy extends PhysicalNamingStrategyStandardImpl { @Override public Identifier toPhysicalTableName(Identifier logicalName, JdbcEnvironment jdbcEnvironment) { diff --git a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/namingstrategy/LongIdentifierNamingStrategy.java b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/namingstrategy/LongIdentifierNamingStrategy.java index 4b5a26692121..e8f466cd5ef6 100644 --- a/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/namingstrategy/LongIdentifierNamingStrategy.java +++ b/hibernate-core/src/test/java/org/hibernate/orm/test/annotations/namingstrategy/LongIdentifierNamingStrategy.java @@ -10,7 +10,6 @@ import org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl; import org.hibernate.boot.model.naming.ImplicitUniqueKeyNameSource; -@SuppressWarnings("serial") public class LongIdentifierNamingStrategy extends ImplicitNamingStrategyJpaCompliantImpl {