From a3083aaa7bac8efac2caec47d66d0d45931ce61c Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Sun, 3 Feb 2013 18:03:55 -0600 Subject: [PATCH] HHH-7957 - Integrate Public Review Draft of the JPA 2.1 spec : schema generation --- .../id/PersistentIdentifierGenerator.java | 10 --------- .../schemagen/JpaSchemaGenerator.java | 21 ++++++++++++------- 2 files changed, 13 insertions(+), 18 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/id/PersistentIdentifierGenerator.java b/hibernate-core/src/main/java/org/hibernate/id/PersistentIdentifierGenerator.java index 51548171b6..2692c67398 100644 --- a/hibernate-core/src/main/java/org/hibernate/id/PersistentIdentifierGenerator.java +++ b/hibernate-core/src/main/java/org/hibernate/id/PersistentIdentifierGenerator.java @@ -95,14 +95,4 @@ public interface PersistentIdentifierGenerator extends IdentifierGenerator { * @return Object an identifying key for this generator */ public Object generatorKey(); - - public String getSchema(); - - public String getCatalog(); } - - - - - - diff --git a/hibernate-entitymanager/src/main/java/org/hibernate/jpa/internal/schemagen/JpaSchemaGenerator.java b/hibernate-entitymanager/src/main/java/org/hibernate/jpa/internal/schemagen/JpaSchemaGenerator.java index 011f6bc4dc..962aae9471 100644 --- a/hibernate-entitymanager/src/main/java/org/hibernate/jpa/internal/schemagen/JpaSchemaGenerator.java +++ b/hibernate-entitymanager/src/main/java/org/hibernate/jpa/internal/schemagen/JpaSchemaGenerator.java @@ -345,6 +345,11 @@ public class JpaSchemaGenerator { private final List commands; private CreateSchemaCommandSource(Configuration hibernateConfiguration, Dialect dialect) { + // NOTES: + // 1) catalogs are currently not handled here at all + // 2) schemas for sequences are not handled here at all + // Both of these are handle-able on the metamodel codebase + final HashSet schemas = new HashSet(); // final HashSet catalogs = new HashSet(); @@ -355,14 +360,14 @@ public class JpaSchemaGenerator { schemas.add( table.getSchema() ); } - final Iterator generators = hibernateConfiguration.iterateGenerators( dialect ); - while ( generators.hasNext() ) { - final IdentifierGenerator generator = generators.next(); - if ( PersistentIdentifierGenerator.class.isInstance( generator ) ) { -// catalogs.add( ( (PersistentIdentifierGenerator) generator ).getCatalog() ); - schemas.add( ( (PersistentIdentifierGenerator) generator ).getCatalog() ); - } - } +// final Iterator generators = hibernateConfiguration.iterateGenerators( dialect ); +// while ( generators.hasNext() ) { +// final IdentifierGenerator generator = generators.next(); +// if ( PersistentIdentifierGenerator.class.isInstance( generator ) ) { +//// catalogs.add( ( (PersistentIdentifierGenerator) generator ).getCatalog() ); +// schemas.add( ( (PersistentIdentifierGenerator) generator ).getSchema() ); +// } +// } // if ( schemas.isEmpty() && catalogs.isEmpty() ) { if ( schemas.isEmpty() ) {