Issue #13: JPQL support for Maps (JPA 2.0)

Type: Feature RequestVersion: 2.0.0Priority: NormalStatus: ActiveReplies: 7
#1

JPQL 2.0 introduces the ability define FROM variables for map keys and values.

Currently ObjectDB supports FROM variables for collection elements.
FROM variables for map keys and values are expected to be supported in future versions.

ObjectDB Support
#2

Any updates on this issue ?

#3

Actually map values are now supported but not map keys.

ObjectDB Support
#4

Hi,

I've tested both KEY and VALUE statements with JPQL with the latest version of ObjectDB 2.3.7.
It seems to me they are not supported.

Query :

"SELECT s FROM Session s JOIN s.data d WHERE VALUE(d) = :value"
Object :
public class Session implements Serializable {
    ...
    @ElementCollection(fetch = EAGER)
    @Column(name = "DATA_VALUE")
    @MapKeyColumn(name = "DATA_KEY")
    @JoinFetch(INNER)
    private Map<String,String> data;
}
Error :
Stacktrace:] with root cause
com.objectdb.o.UserException: Unexpected query token 'VALUE'
at com.objectdb.o.MSG.d(MSG.java:61)
at com.objectdb.o.TKN.J(TKN.java:765)
at com.objectdb.o.QSP.E(QSP.java:484)
at com.objectdb.o.QSP.A(QSP.java:250)
at com.objectdb.o.QSP.y(QSP.java:127)

 

 

#5

The VALUE keyword is indeed unsupported yet.

Try:

SELECT s FROM Session s JOIN s.data d WHERE d = :value
ObjectDB Support
#6

That works. 
Please let us know when/if the KEY and VALUE keywords are supported.

Best regards,
./M

#7

Any updates on this issue ?

Best regards,

Mark

#8

No news yet regarding this issue, unfortunately.

ObjectDB Support

Reply