Good morning
I am using the latest Hibernate versions (Hibernate Core 3.2.3 and Hibernate Annotation 3.3.0).
QUESTION:
Is it possible to use in conjunction Java enums and Hibernate Formula mechanism?
In other words is it possible to get something like this:
Code:
public enum Day
{
MONDAY,
TUESDAY
}
and ...:
Code:
public class MyEntity
{
...
Day day;
@Formula("CASE" +
" WHEN NUM=1 THEN 'MONDAY'" +
" WHEN NUM=2 THEN 'TUESDAY'" +
" END")
public Day getDay()
{
return day;
}
...
}
Unfortunately I cannot get it work for me.
Kind regards,
Adam Woźniak