mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-17 08:35:13 +00:00
HHH-11739 - Fix tests
This commit is contained in:
parent
c25a859ade
commit
3f60619f3f
@ -58,6 +58,32 @@ public void doTestWork(StandardServiceRegistry ssr) {
|
||||
);
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-9491" )
|
||||
public void testExplicitQuotingSkippingColumnDef() {
|
||||
withStandardServiceRegistry(
|
||||
false,
|
||||
true,
|
||||
new TestWork() {
|
||||
@Override
|
||||
public void doTestWork(StandardServiceRegistry ssr) {
|
||||
MetadataImplementor metadata = (MetadataImplementor) new MetadataSources( ssr )
|
||||
.addAnnotatedClass( E1.class )
|
||||
.buildMetadata();
|
||||
metadata.validate();
|
||||
|
||||
PersistentClass entityBinding = metadata.getEntityBinding( E1.class.getName() );
|
||||
|
||||
org.hibernate.mapping.Column idColumn = extractColumn( entityBinding.getIdentifier().getColumnIterator() );
|
||||
assertTrue( isQuoted( idColumn.getSqlType(), ssr ) );
|
||||
|
||||
org.hibernate.mapping.Column otherColumn = extractColumn( entityBinding.getProperty( "other" ).getColumnIterator() );
|
||||
assertTrue( isQuoted( otherColumn.getSqlType(), ssr ) );
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
private org.hibernate.mapping.Column extractColumn(Iterator columnIterator) {
|
||||
return (org.hibernate.mapping.Column) columnIterator.next();
|
||||
}
|
||||
@ -70,10 +96,10 @@ private boolean isQuoted(String sqlType, StandardServiceRegistry ssr) {
|
||||
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-9491" )
|
||||
public void testGlobalQuotingOptIn() {
|
||||
public void testGlobalQuotingNotSkippingColumnDef() {
|
||||
withStandardServiceRegistry(
|
||||
true,
|
||||
true,
|
||||
false,
|
||||
new TestWork() {
|
||||
@Override
|
||||
public void doTestWork(StandardServiceRegistry ssr) {
|
||||
@ -96,10 +122,10 @@ public void doTestWork(StandardServiceRegistry ssr) {
|
||||
|
||||
@Test
|
||||
@TestForIssue( jiraKey = "HHH-9491" )
|
||||
public void testGlobalQuotingOptOut() {
|
||||
public void testGlobalQuotingSkippingColumnDef() {
|
||||
withStandardServiceRegistry(
|
||||
true,
|
||||
false,
|
||||
true,
|
||||
new TestWork() {
|
||||
@Override
|
||||
public void doTestWork(StandardServiceRegistry ssr) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user