This content has been marked as final.
Show 3 replies
-
1. Re: HQL and enum constants
andydale Feb 22, 2007 10:55 AM (in response to alexg79)Hi.
try this:SELECT DISTINCT m FROM Material m, IN(m.suppliers) s WHERE m.unit <> Material$MaterialUnit.SQUARE_METRES AND s.id = :id
I am not sure if you will need the package name before Material.
Cheers,
Andy -
2. Re: HQL and enum constants
alexg79 Feb 22, 2007 11:05 AM (in response to alexg79)Tried that, and "com.foo.Material$MaterialUnit.SQUARE_METRES", no dice. Gives the same error still.
-
3. Re: HQL and enum constants
alexg79 Feb 22, 2007 11:10 AM (in response to alexg79)For the record, here's the code for the MaterialUnit enum inside the Material class:
public enum MaterialUnit { SQUARE_METRES("m\u00b2"), ROLLS("rll"), PIECES("kpl"), KILOGRAMS("kg"); private final String name; private MaterialUnit(final String name) { this.name = name; } @Override public String toString() { return name; } }