Problem loading entities with enums via DataManager or JmixDataRepository

Hi all,

I have encountered a nasty problem when trying to load entities which contain enums.
The behavior is similar when either using DataManager oder JmixDataRepository.

Case:

The query that raises the problem is:

select distinct e.o.s from T_E e

Without going into the depths of the data model, let for the moment assume that we have 3 Tables T_E representing entity E, T_O representing entity O and T_S representing Entity S. There are 1:n relationships between E -> O -> S.

(Remark: please do also note that S is an Entity superclass with @Inheritance(strategy = InheritanceType.JOINED), in case that plays any role, which I doubt in this case.)

Now class E has an enum-Attribute, which is correctly represented by a String in the java descriptor class created with the Jmix studio.

This leads to EclipseLink complaining:

ValidationException: 
Exception Description: Attribute oType of FetchGroup(){oType, [...], id} is not mapped.
at org.eclipse.persistence.exceptions.ValidationException.fetchGroupHasUnmappedAttribute(ValidationException.java:2958)
	at org.eclipse.persistence.descriptors.FetchGroupManager.prepareAndVerifyInternal(FetchGroupManager.java:308)
[...]

(omissions “[…]” edited in by me.)

Remark: loading these entities directly (e.g. in a generated entity browser) works just fine.

Hypothesis:

I suspect that this may be due to EclipseLink trying to map the Jmix String respresentation to an enum using its in-built JPA strategy (maybe searching for an @Enumerated tag, which is not present).
Anything that can be done about this? Any ideas or thoughts would be most appreciated.

Thank you.

Hi @dominik

It seems that your question is not generic. We will be able to help you if you send us a small sample project along with a reproduction scenario that demonstrates the issue. It could be helpful to avoid any misunderstanding.

Regards,
Nadezhda.