ObjectDB ObjectDB

Issue #2369: Update query null error

Type: Bug ReoprtVersion: 2.7.6Priority: NormalStatus: ActiveReplies: 6
#1

it still does not work, using (directly in explorer)

Update Action a Set a.transferred = 0
where a.objectsInCharge.nodePath like "/(PR)W4455NS01%" and a.objectsInCharge.nodePath like "%MARAS%"

or

Update Action Set transferred = 0
here objectsInCharge.nodePath like "/(PR)W4455NS01%" and objectsInCharge.nodePath like "%MARAS%"

both result in:

Query Execution Error
=====================
null

Query

select a from  Action a
where a.objectsInCharge.nodePath like "/(PR)W4455NS01%" and a.objectsInCharge.nodePath like "%MARAS%"

shows the expected results

edit
delete
#2

Could you please demonstrate it with a query that has results with the sample database that you sent us, as this specific query returns no results.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
edit
delete
#3

try that:

select a from  Action a
where a.objectsInCharge.nodePath like "/(CR)70005%" and a.objectsInCharge.nodePath like "%(PR)70005%"

Update Action a Set a.transferred = 0
where a.objectsInCharge.nodePath like "/(CR)70005%" and a.objectsInCharge.nodePath like "%(PR)70005%"
edit
delete
#4

The problem is that the expressions a.objectsInCharge.nodePath and a.objectsInCharge.nodePath are translated to JOIN expressions, which are not allowed in JPQL Update queries.

See discussions on this issue.

ObjectDB should produce a better error message in that case of course.

 

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
edit
delete
#5

just as a remark, doing the query via the dictionary (that we keep in parallel to the linked objects) everything works fine:

query:

select a from Action a
WHERE a.actionDictionary.get('(TC)') = '/(TC)MILLING' and a.actionDictionary.get('(PO)') like '/(PR)W4455NS01%'

update:

update Action a eet a.transferred = 0
HERE a.actionDictionary.get('(TC)') = '/(TC)MILLING' and a.actionDictionary.get('(PO)') like '/(PR)W4455NS01%'
edit
delete
#6

A map is not an entity class so it doesn't extend the expression path with a JOIN.

If this feature is essential to you it may be possible to add it as an extension (will have to check).

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
edit
delete
#7

It is not essential, we can work around with the dictionary. Would be helpfull if there could be performance improvements with the dictionaries as discussed in another thread

edit
delete

Reply

To post on this website please sign in.