Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2471530

Browse files
committed
Name static inner entities to avoid issues on HANA
1 parent 09f4b96 commit 2471530

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

hibernate-core/src/test/java/org/hibernate/orm/test/associations/ExplicitIdentifierTest.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import org.hibernate.boot.model.naming.Identifier;
1414
import org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl;
1515
import org.hibernate.cfg.AvailableSettings;
16-
import org.hibernate.dialect.HSQLDialect;
1716
import org.hibernate.engine.jdbc.env.spi.JdbcEnvironment;
1817
import org.hibernate.testing.orm.junit.DomainModel;
1918
import org.hibernate.testing.orm.junit.JiraKey;
@@ -55,23 +54,19 @@ void testImplicitIdentifier(SessionFactoryScope scope) {
5554
scope.inTransaction( session -> {
5655

5756
assertEquals( "implicit", session.createNativeQuery(
58-
session.getDialect() instanceof HSQLDialect ?
59-
"select COLUMN_name from \"TABLE_`ExplicitIdentifierTest$PersonImplicit`\""
60-
: "select COLUMN_name from TABLE_ExplicitIdentifierTest$PersonImplicit",
57+
"select COLUMN_name from TABLE_PersonImplicit",
6158
String.class )
6259
.getSingleResult() );
6360

6461
if ( session.getDialect().getSequenceSupport().supportsSequences() ) {
6562
assertEquals( 51, session.createNativeQuery(
6663
session.getDialect().getSequenceSupport()
67-
.getSequenceNextValString( session.getDialect() instanceof HSQLDialect
68-
? "\"SEQUENCE_`TABLE_`ExplicitIdentifierTest$PersonImplicit`_SEQ`\""
69-
: "SEQUENCE_TABLE_ExplicitIdentifierTest$PersonImplicit_SEQ" ),
64+
.getSequenceNextValString( "SEQUENCE_TABLE_PersonImplicit_SEQ" ),
7065
Integer.class ).getSingleResult() );
7166
}
7267
else {
7368
assertEquals( 51, session.createNativeQuery(
74-
"select next_val from TABLE_TABLE_ExplicitIdentifierTest$PersonImplicit_SEQ",
69+
"select next_val from TABLE_TABLE_PersonImplicit_SEQ",
7570
Integer.class ).getSingleResult() );
7671
}
7772
} );
@@ -114,7 +109,7 @@ public void dropTestData(SessionFactoryScope scope) {
114109
scope.dropData();
115110
}
116111

117-
@Entity
112+
@Entity(name = "PersonImplicit")
118113
public static class PersonImplicit {
119114

120115
@Id
@@ -125,7 +120,7 @@ public static class PersonImplicit {
125120
String name;
126121
}
127122

128-
@Entity
123+
@Entity(name = "PersonExplicit")
129124
@Table(name = "PersonExplicit")
130125
public static class PersonExplicit {
131126

0 commit comments

Comments
 (0)