I have an entity, Order with an enum attribute: Status. With options as Created, Planned, Executed, Billed.
I want to check whether the status of my order comes after the status Planned. Can I do this with an expression?
Something like this: https://www.tutorialspoint.com/java/lang/enum_compareto.htm
My solution to this problem would be:
Enum_Status = ‘Executed’ or Enum_Status = ‘Billed’
As far as I know enum do not have a specific order other than alphabetical for sorting.
Create integer variable with
if Enum_Status = ‘Created’
else if Enum_Status = ‘Planned’
else if Enum_Status = ‘Billed’
else if Enum_Status = ‘Executed’
and finally compare this number to the enum value of your choice