Native ObjectDB Support for EnumSet ?

#1

Greetings ObjectDB team,

Are embedded EnumSet objects faster to query than normal classes ?

Does JPA/JDO offer native support to filter persistent objects by an EnumSet field's multi values ?

For example:

WHERE o.es == ES.A | ES.B | ES.C

Thank you !

#2

Embedded enum sets are supported and are fast (but I am not sure to which classes you want to compare them).

Currently you should declare the fields as Set<MyEnum> rather than EnumSet<MyEnum> - otherwise you will not be able to see the enum set values in the Explorer (but you can instantiate it as EnumSet<MyEnum>).

JDO/JDOQL (single string) query for example:

SELECT FROM MyEntity WHERE this.enumSet.contains(:arg)

JPA/JPQL  query for example:

SELECT e FROM MyEntity e JOIN e.enumSet item WHERE item = :arg

 

ObjectDB Support

Reply