public class MamyToManyWithGlobalQuotingAnnotationTest {
protected ServiceRegistry serviceRegistry;
protected MetadataImplementor metadata;
@Test
public void createSchema() throws Exception {
SchemaExport schemaExport = new SchemaExport( serviceRegistry, metadata );
schemaExport.create( true, true );
List<SQLException> exceptions = schemaExport.getExceptions();
for ( SQLException exception : exceptions ) {
String sqlState = exception.getSQLState();
assertThat( sqlState, not( "42000" ) );
}
}
@Before
public void setUp() {
serviceRegistry = new StandardServiceRegistryBuilder().applySetting(
Environment.GLOBALLY_QUOTED_IDENTIFIERS,
"true"
).build();
metadata = (MetadataImplementor) new MetadataSources( serviceRegistry )
.addAnnotatedClass( MyEntityWithRoles.class )
.addAnnotatedClass( Role.class )
.buildMetadata();
System.out.println( "********* Starting SchemaExport for START-UP *************************" );
SchemaExport schemaExport = new SchemaExport( serviceRegistry, metadata );
schemaExport.create( true, true );
System.out.println( "********* Completed SchemaExport for START-UP *************************" );
}
@After
public void tearDown() {
System.out.println( "********* Starting SchemaExport (drop) for TEAR-DOWN *************************" );
SchemaExport schemaExport = new SchemaExport( serviceRegistry, metadata );
schemaExport.drop( true, true );
System.out.println( "********* Completed SchemaExport (drop) for TEAR-DOWN *************************" );
StandardServiceRegistryBuilder.destroy( serviceRegistry );
serviceRegistry = null;
}
}