You'd use SELECT e FROM Entity e WHERE e.type = Outer$Inner.TYPE1 (or Outer.Inner.TYPE1, I always forget).
This doesn't work. Both variants doesn't work. I tried it with 4.11, 5.0.3 and 5.1.0. With Outer$Inner.TYPE1 the exception is org.hibernate.hql.internal.ast.InvalidPathException: Invalid path: 'Outer$Inner.TYPE1'. With Outer.Inner.TYPE1 the exception is org.hibernate.hql.internal.ast.InvalidPathException: Invalid path: 'null.Inner.TYPE1'. My attachment with test case from previous post shows this. It uses 4.11 version of hibernate. But you can easily change this adding gradle.properties file into root project folder with this content:
hibernate.version = 5.1.0.Final
and then gradlew test again. If you decide to fix this, I think the syntax with $ sign is more correct because it is how it works now with FQN (i.e. com.acme.Outer$Inner.TYPE1 works now). |