SQLQuery class definition problem

Hi,

I have a SQLQuery which matches by iterating over a list property in an entry and determining if it contains a specific value. The class definition uses the generic type List<String>, when instantiated the list is actually an ArrayList<String>.

When executing a SQLQuery using the class type I receive a "org.openspaces.core.BadSqlQueryException: Failed to execute SQLQuery".

The nested exception is "com.j_spaces.core.DetailedUnusableEntryException: The operation's type description is incompatible with the type description stored in the space."

It's thrown at:

at com.gigaspaces.internal.server.space.metadata.SpaceTypeManager.validateChecksum(SpaceTypeManager.java:499)
at com.gigaspaces.internal.server.space.metadata.SpaceTypeManager.validateChecksum(SpaceTypeManager.java:477)

The detail is below, I've simplified it:

Type=[com.company.MyObject], Server checksum=[1358725497], Operation checksum=[-971745424].
Server type description:
Super classes: 2
   1: Type=[com.company.MyObject]
   2: Type=[java.lang.Object]
Properties: 4
   1: Name=[classList], Type=[java.util.ArrayList]
Checksum: 1358725497.

Operation type description:
Super classes: 2
   1: Type=[com.company.MyObject]
   2: Type=[java.lang.Object]
Properties: 4
   1: Name=[classList], Type=[java.util.List]
Checksum: -971745424.

So on the server the class definition metadata seems to be using the concrete type of the list, but the SQLQuery obviously can only look at the class definition and so uses the interface.

I can fix this by using ArrayList in the class definition but I would prefer to use the interface, is there any way around this problem?

asked 2015-11-20 05:25:07 -0600

jmg gravatar image

updated 2015-11-20 05:28:53 -0600

edit retag flag offensive close merge delete