2323import org .hibernate .MappingException ;
2424import org .hibernate .SessionFactory ;
2525import org .hibernate .SessionFactoryObserver ;
26- import org .hibernate .boot .Metadata ;
2726import org .hibernate .boot .MetadataBuilder ;
2827import org .hibernate .boot .MetadataSources ;
2928import org .hibernate .boot .SessionFactoryBuilder ;
@@ -470,9 +469,9 @@ public Configuration configure(File configFile) throws HibernateException {
470469 * @param highlightSql should logged SQL be highlighted with pretty colors
471470 */
472471 public Configuration showSql (boolean showSql , boolean formatSql , boolean highlightSql ) {
473- setProperty ( AvailableSettings .SHOW_SQL , Boolean .toString (showSql ) );
474- setProperty ( AvailableSettings .FORMAT_SQL , Boolean .toString (formatSql ) );
475- setProperty ( AvailableSettings .HIGHLIGHT_SQL , Boolean .toString (highlightSql ) );
472+ setProperty ( JdbcSettings .SHOW_SQL , Boolean .toString (showSql ) );
473+ setProperty ( JdbcSettings .FORMAT_SQL , Boolean .toString (formatSql ) );
474+ setProperty ( JdbcSettings .HIGHLIGHT_SQL , Boolean .toString (highlightSql ) );
476475 return this ;
477476 }
478477
@@ -482,7 +481,7 @@ public Configuration showSql(boolean showSql, boolean formatSql, boolean highlig
482481 * @param action the {@link Action}
483482 */
484483 public Configuration setSchemaExportAction (Action action ) {
485- setProperty ( AvailableSettings .HBM2DDL_AUTO , action .getExternalHbm2ddlName () );
484+ setProperty ( SchemaToolingSettings .HBM2DDL_AUTO , action .getExternalHbm2ddlName () );
486485 return this ;
487486 }
488487
@@ -493,8 +492,8 @@ public Configuration setSchemaExportAction(Action action) {
493492 * @param pass the password
494493 */
495494 public Configuration setCredentials (String user , String pass ) {
496- setProperty ( AvailableSettings .USER , user );
497- setProperty ( AvailableSettings .PASS , pass );
495+ setProperty ( JdbcSettings .USER , user );
496+ setProperty ( JdbcSettings .PASS , pass );
498497 return this ;
499498 }
500499
@@ -514,7 +513,7 @@ public Configuration setJdbcUrl(String url) {
514513 * @param jndiName the JNDI name of the datasource
515514 */
516515 public Configuration setDatasource (String jndiName ) {
517- setProperty ( AvailableSettings .DATASOURCE , jndiName );
516+ setProperty ( JdbcSettings .DATASOURCE , jndiName );
518517 return this ;
519518 }
520519
@@ -524,7 +523,7 @@ public Configuration setDatasource(String jndiName) {
524523 * @param transactionType the {@link PersistenceUnitTransactionType}
525524 */
526525 public Configuration setTransactionType (PersistenceUnitTransactionType transactionType ) {
527- setProperty ( AvailableSettings .JAKARTA_TRANSACTION_TYPE , transactionType .toString () );
526+ setProperty ( PersistenceSettings .JAKARTA_TRANSACTION_TYPE , transactionType .toString () );
528527 return this ;
529528 }
530529
@@ -783,8 +782,8 @@ public Configuration addAnnotatedClass(Class<?> annotatedClass) {
783782 *
784783 * @return this (for method chaining)
785784 */
786- public Configuration addAnnotatedClasses (Class ... annotatedClasses ) {
787- for (Class annotatedClass : annotatedClasses ) {
785+ public Configuration addAnnotatedClasses (Class <?> ... annotatedClasses ) {
786+ for ( var annotatedClass : annotatedClasses ) {
788787 addAnnotatedClass ( annotatedClass );
789788 }
790789 return this ;
@@ -814,7 +813,7 @@ public Configuration addPackage(String packageName) throws MappingException {
814813 * @throws MappingException in case there is an error in the mapping data
815814 */
816815 public Configuration addPackages (String ... packageNames ) throws MappingException {
817- for (String packageName : packageNames ) {
816+ for ( String packageName : packageNames ) {
818817 addPackage ( packageName );
819818 }
820819 return this ;
@@ -1078,8 +1077,8 @@ public SessionFactory buildSessionFactory(ServiceRegistry serviceRegistry) throw
10781077 .forEach ( metadataBuilder ::applyAttributeConverter );
10791078 }
10801079
1081- final Metadata metadata = metadataBuilder .build ();
1082- final SessionFactoryBuilder sessionFactoryBuilder = metadata .getSessionFactoryBuilder ();
1080+ final var metadata = metadataBuilder .build ();
1081+ final var sessionFactoryBuilder = metadata .getSessionFactoryBuilder ();
10831082
10841083 if ( interceptor != null && interceptor != EmptyInterceptor .INSTANCE ) {
10851084 sessionFactoryBuilder .applyInterceptor ( interceptor );
@@ -1130,7 +1129,7 @@ public SessionFactory buildSessionFactory(ServiceRegistry serviceRegistry) throw
11301129 public SessionFactory buildSessionFactory () throws HibernateException {
11311130 log .trace ( "Building session factory using internal StandardServiceRegistryBuilder" );
11321131 standardServiceRegistryBuilder .applySettings ( properties );
1133- StandardServiceRegistry serviceRegistry = standardServiceRegistryBuilder .build ();
1132+ var serviceRegistry = standardServiceRegistryBuilder .build ();
11341133 try {
11351134 return buildSessionFactory ( serviceRegistry );
11361135 }
0 commit comments