File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed
hibernate-core/src/test/java/org/hibernate/test/unionsubclass3 Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change 6
6
*/
7
7
package org .hibernate .test .unionsubclass3 ;
8
8
9
- import org .hibernate .Session ;
10
- import org .hibernate .Transaction ;
11
- import org .hibernate .query .Query ;
12
-
13
9
import org .hibernate .testing .TestForIssue ;
14
10
import org .hibernate .testing .junit4 .BaseCoreFunctionalTestCase ;
15
11
import org .junit .Test ;
23
19
import javax .persistence .InheritanceType ;
24
20
import javax .persistence .ManyToOne ;
25
21
26
- import org .hibernate .test .locking .A ;
27
-
28
22
import static org .hibernate .testing .transaction .TransactionUtil .doInHibernate ;
29
23
import static org .junit .Assert .assertEquals ;
30
24
@@ -81,8 +75,7 @@ public void testUnionSubclassClassResults() {
81
75
session .persist (child2 );
82
76
session .persist (child3 );
83
77
session .persist (child4 );
84
- } );
85
-
78
+ });
86
79
doInHibernate ( this ::sessionFactory , session -> {
87
80
List results = session .createQuery (
88
81
"select c " +
@@ -98,6 +91,19 @@ public void testUnionSubclassClassResults() {
98
91
} );
99
92
}
100
93
94
+ @ Test
95
+ @ TestForIssue ( jiraKey = "HHH-12565" )
96
+ public void typeOfLeafTPC () {
97
+ doInHibernate ( this ::sessionFactory , session -> {
98
+ List results = session .createQuery (
99
+ "select TYPE(f) " +
100
+ "from Father f" +
101
+ " where f.id = -1" )
102
+ .getResultList ();
103
+ assertEquals (0 , results .size ());
104
+ } );
105
+ }
106
+
101
107
@ Entity (name = "Child" )
102
108
public static class Child
103
109
{
You can’t perform that action at this time.
0 commit comments