About WHERE

issue

InternalException when using MEMBER OF on a large list in a query

Hello, we get when executing a query with MEMBER OF on a large list the following InternalException: Caused by: com.objectdb.o.InternalException: merge2 com.btc.ep.coverage.bl.internal.dmos.CoverageRecordImpl:null => merger[2850057]-missing:223 at com.objectdb.o.PBI.B(PBI.java:124) at com.objectdb.o.PBI.q(PBI.jave:97) at com.objectdb.o.OBI.Vp(OBI.java:244) (... more see attached Image) Our query looks like this: ... + recordClassName + " AS record " + "WHERE property.uid MEMBER OF record.properties AND property.scopeID MEMBER OF ... FROM CovPropImpl AS property, CovRecImpl AS record WHERE property.uid MEMBER OF record.properties" But after adding the ...

 
manual

UPDATE SET Queries in JPA/JPQL

Explains how to apply server side bulk update using a JPA/JPQL query.... the GROUP BY, HAVING and ORDER BY clauses, but the WHERE clause, which is essential for updating selected entity objects, is ... population = population * 11 / 10 WHERE c . population < :p The query can be executed as ...

 
forum_thread

A nested SELECT

Hello. I have a query UPDATE Look l SET l.partlySold = FALSE WHERE (SELECT count(a) FROM l.things a WHERE a.thing.status != :status) <= 1 which doesn't work: "Unexpected query token 'SELECT'". Does ObjectDB support queries like this? Thanks. ... UPDATE Look l SET l . partlySold = FALSE WHERE ( SELECT count ( a ) FROM l . things a WHERE a . thing . STATUS ! = : STATUS ) <= 1 ...

 
issue

Update query bug

Some code. Problem in UPDATE query.   ... ( "SELECT t FROM Person p JOIN p.transports t WHERE p.personalCode = :code" ) ;   query . setParameter ... ( "UPDATE Person p SET p.transports = :list WHERE p.personalCode = :code" , Person . class ) ; query2 . ...

 
forum_thread

how explorer queries work

i'm curious as to how the explorer is able to execute queries when its obviously not aware of the object model that i built. the reason is because i have an application where i want to be able to execute somewhat generalized queries and i won't know what classes are in the object model ahead of time. this is especially curious to me in client-server mode since the .jar with the object model classes is on the server side, not the client side where explorer is running. ... that i built. the reason is because i have an application where i want to be able to execute somewhat generalized queries and i won't ... model classes is on the server side, not the client side where explorer is running. i can figure out how to load the classes in ...

 
manual

Comparison in JPQL and Criteria API

Explains how comparison operators can be used in JPQL queries, including in comparing null values.... JPQL queries use at least one comparison operator in their WHERE clause. This page covers the following topics: ... the Not Equal operators. JPQL follows the SQL notation, where Java uses its own notation (which is also in use by JDOQL, the JDO Query ...

 
forum_thread

Should derived fields of an EmbeddedId be manually maintained by app code?

If I have an Entity which has a primary key which is derived and I am implementing it using @EmbeddedId, am I responsible for maintaining the derived fields of the @EmbeddedId? I could not find anything in the JPA 2.0 spec http://download.oracle.com/auth/otn-pub/jcp/persistence-2.0-fr-oth-JSpec/persistence-2_0-final-spec.pdf?e=1317047713&h=54831c176e81a244a4c309e13eba0b27 which tells me what to expect. ... fields in the embeddedIds explicitly and the test fails where it attempts to find an item with an @EmbeddedId ... ... query = "SELECT COUNT(x) FROM ECompoundKeyMapItem x WHERE x.container = :container" ) } ) public ...

 
forum_thread

slow performance for a complex query

Hi, We have a query that is constructed dynamically, an example is like this: SELECT DISTINCT $1 FROM CDI $1, Organisation $2, Organisation $3 WHERE ((UPPER($1.cdiId) LIKE 'THREAD14%') AND ((($1.parentOrgId='news') OR (($1.parentOrgId=$2.organisationId) AND ($2.parentOrgId='news'))) OR ((($1.parentOrgId=$3.organisationId) AND ($3.parentOrgId=$2.organisationId)) AND ($2.parentOrgId='news')))) I've also tried running the CDI query first and passing the results into the organisation query as follows: ... FROM CDI $1 , Organisation $2 , Organisation $3 WHERE ( ( UPPER ( $1 . cdiId ) LIKE ... FROM CDI $1 , Organisation $2 , Organisation $3 WHERE ( ( $1 . id IN :cdiids ) AND ( ...

 
forum_thread

Possible issue for JPQL IN expression

Possible issue for JPQL IN expression with a set of more than one string literals values in the path expression. ... thread "main" [ObjectDB 2.3.7_10] SELECT e FROM MyEntity e WHERE e.country IN ('US' ==> , <==  'SP', ... use a parameter: SELECT e FROM MyEntity e WHERE e . country IN :countries and send a collection of ...

 
forum_thread

@ElementCollection query returning extra result per element in collection

Hi, ... SELECT $1 FROM Company $1 WHERE ((LOWER($1.name) LIKE :p1) AND (($1.conditionOne=:p2))) Got: 1 results - ... SELECT $1 FROM Company $1 WHERE ((LOWER($1.name) LIKE :p1) AND ((($1.branches.branch=:p2) OR ...