diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/ImplicitNamingStrategy.java b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/ImplicitNamingStrategy.java index 888fc2257d02..301f1380bd1d 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/ImplicitNamingStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/ImplicitNamingStrategy.java @@ -16,7 +16,7 @@ * has no {@link jakarta.persistence.Table @Table} annotation, then * {@link #determinePrimaryTableName(ImplicitEntityNameSource) determinePrimaryTableName} * is called with an {@link ImplicitEntityNameSource} providing access to information - * about the Java class and its {@link jakarta.persistence.Entity#name() entity name}. + * about the Java class and its {@linkplain jakarta.persistence.Entity#name entity name}. *

* On the other hand, when a logical name is explicitly specified, for example, * using {@link jakarta.persistence.Table#name() @Table} to specify the table name, @@ -34,7 +34,7 @@ * implementation of {@code ImplicitNamingStrategy}. *

* An {@code ImplicitNamingStrategy} may be selected using the configuration property - * {@value org.hibernate.cfg.AvailableSettings#IMPLICIT_NAMING_STRATEGY}. + * {@value org.hibernate.cfg.MappingSettings#IMPLICIT_NAMING_STRATEGY}. * * @apiNote The method names here mostly favor the JPA terminology, * for example, "secondary table" rather than "join". @@ -42,7 +42,7 @@ * @see PhysicalNamingStrategy * @see org.hibernate.cfg.Configuration#setImplicitNamingStrategy(ImplicitNamingStrategy) * @see org.hibernate.boot.MetadataBuilder#applyImplicitNamingStrategy(ImplicitNamingStrategy) - * @see org.hibernate.cfg.AvailableSettings#IMPLICIT_NAMING_STRATEGY + * @see org.hibernate.cfg.MappingSettings#IMPLICIT_NAMING_STRATEGY * * @author Steve Ebersole */ diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/PhysicalNamingStrategy.java b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/PhysicalNamingStrategy.java index 1f9073f5ccb1..f9a9bdfd3b88 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/PhysicalNamingStrategy.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/PhysicalNamingStrategy.java @@ -29,12 +29,12 @@ * names, so the abstraction here is in some sense "incomplete". *

* A {@code PhysicalNamingStrategy} may be selected using the configuration property - * {@value org.hibernate.cfg.AvailableSettings#PHYSICAL_NAMING_STRATEGY}. + * {@value org.hibernate.cfg.MappingSettings#PHYSICAL_NAMING_STRATEGY}. * * @see ImplicitNamingStrategy * @see org.hibernate.cfg.Configuration#setPhysicalNamingStrategy(PhysicalNamingStrategy) * @see org.hibernate.boot.MetadataBuilder#applyPhysicalNamingStrategy(PhysicalNamingStrategy) - * @see org.hibernate.cfg.AvailableSettings#PHYSICAL_NAMING_STRATEGY + * @see org.hibernate.cfg.MappingSettings#PHYSICAL_NAMING_STRATEGY * * @author Steve Ebersole */ diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/PhysicalNamingStrategySnakeCaseImpl.java b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/PhysicalNamingStrategySnakeCaseImpl.java index e6904a72726b..043da4b95819 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/naming/PhysicalNamingStrategySnakeCaseImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/naming/PhysicalNamingStrategySnakeCaseImpl.java @@ -14,6 +14,18 @@ /** * Converts {@code camelCase} or {@code MixedCase} logical names to {@code snake_case}. + *

+ * This strategy leaves quoted identifiers alone. If quoted identifiers should also be + * processed, then this class may be extended the implement the required behavior. For + * example: + *

+ * public class AlwaysSnakeEverythingStrategy extends PhysicalNamingStrategySnakeCaseImpl {
+ *     @Override
+ *     protected Identifier quotedIdentifier(Identifier quotedName) {
+ *         return super.unquotedIdentifier( quotedName ).quoted();
+ *     }
+ * }
+ * 
* * @author Phillip Webb * @author Madhura Bhave @@ -59,7 +71,7 @@ else if ( name.isQuoted() ) { } private String camelCaseToSnakeCase(String name) { - final StringBuilder builder = new StringBuilder( name.replace( '.', '_' ) ); + final var builder = new StringBuilder( name.replace( '.', '_' ) ); for ( int i = 1; i < builder.length() - 1; i++ ) { if ( isUnderscoreRequired( builder.charAt( i - 1 ), builder.charAt( i ), builder.charAt( i + 1 ) ) ) { builder.insert( i++, '_' );