_ebean_setField ClassCastException; like ebean got the order of the entity properties wrong

32 views
Skip to first unread message

xu lakxe

unread,
May 9, 2023, 11:39:38 AM5/9/23
to Ebean ORM
Hi,Rob
I use a federated primary key, create a federated foreign key, and associate many-to-one.
I failed when testing save. The error message is as follows:
set tenantId on [org.example.domain.AssetsObjectFieldId] arg[creator] type[org.example.domain.AssetsObjectFieldId] threw error

Caused by: java.lang.ClassCastException: class java.lang.String cannot be cast to class java.lang.Long (java.lang.String and java.lang.Long are in module java.base of loader 'bootstrap')

It feels like ebean sets the value of the creator field to the tenantId field.
I tried to create a test case to reproduce the problem, but I found that this problem only occurs in my environment, so the test case I provided now reports another error, which I think may be a similar problem. Even if I add a value to the creator field, it will not be saved successfully, and when I save the object, even if the value of tenantId is set, an exception that tenantId is not set will be thrown (because I have constraints on tenantId).

The specific test case is here:

Could you please confirm if this is an ebean issue when you have time? Thanks for contributing such a great ORM framework.

Reply all
Reply to author
Forward
0 new messages