According to the Hibernate manual, it is possible to use public static final constants
directly in HQL queries.
Why then can I not use enums there as well?
I tried
| SELECT DISTINCT m FROM Material m, IN(m.suppliers) s WHERE m.unit <>
Material.MaterialUnit.SQUARE_METRES AND s.id = :id
|
and variations like "MaterialUnit.SQUARE_METRES" and the fully qualified name,
but they all produce the same error message on deployment:
anonymous wrote :
| 13:55:36,982 ERROR [SessionFactoryImpl] Error in named query: Material.nonCuttables
| org.hibernate.hql.ast.QuerySyntaxException: Invalid path:
'null.MaterialUnit.SQUARE_METRES' [SELECT DISTINCT m FROM
fi.karico.etikettu.domain.Material m, IN(m.suppliers) s WHERE m.unit <>
Material.MaterialUnit.SQUARE_METRES AND s.id = :id]
|
The same works fine if I just input the enum as a parameter:
| SELECT DISTINCT m FROM Material m, IN(m.suppliers) s WHERE m.unit <> :m2unit AND
s.id = :id
|
What am I doing wrong?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4020510#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...