This is not a bug. Look. This is a breaking change in terms of it broke what you were doing previously. Ok. However, you have to look at why you were doing that. The bottom line is that it "just so happened to work". That's accidental. In order for something to be a bug it has to be something that does not "work as intended". For a library the only source of "works as intended" is the documentation (including blogs, etc) somewhere saying that this is an expected feature. For Hibernate and other JPA providers this also extends to the JPA spec itself. None of that applies here. So we can categorize this as an enhancement request. Which is exactly what I will do. But I have to say that I am personally very -1 against this. Essentially you are arguing to allow mixing direct SQL fragments in HQL/JPQL. I think HQL/JPQL should remain at the object level; that's kind of the whole point. Certainly I'd argue against this for allowing ordinal literals. Enum-name literals... meh. BTW. It is inaccurate that you have to supply the FQN for the enum literal. You could actually just use the "simple name". I.e., the following query should also work:
SELECT e FROM Entity e WHERE e.type = EntityType.TYPE1
Yes, this is a Hibernate-specific feature (non-JPA compliant). But since y'all are arguing a Hibernate-specific extension anyway, that is not really an argument. |