About WHERE

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

Problem with @OrderBy

When I use @OrderBy and supply multiple order fields I get and error when ObjectDB loads that entity. Example code: @Entity @Table(name="Problems", schema = myDB") public class Defects  implements Serializable { ... ...  @OneToMany(mappedBy="problem") @OrderBy("seqRel, noteSeq") Set<Notes> notes; ... ... } ... } The error is printed on the console where I started the Explorer Th error that seems most informative is: ... SELECT owner FROM Notes owner JOIN owner.defect inverse WHERE inverse = ?1 ORDER BY owner.seqRel, ==> noteSeq ...

 
forum_thread

Query by array element

Hello, I have a class as follows: @Entity public class MyEntity {     boolean properties[]= new boolean[1024]; } I would like to query objects with feature '42': select me from MyEntity me where me.properties[42]=true Is it possible? Thank you! ... '42': SELECT me FROM MyEntity me WHERE me . properties [ 42 ] = true Is it ... ( "SELECT me FROM MyEntity me WHERE me.isProperty(42)" ) ; System. out . ...

 
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

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 ...

 
api-jdo

javax.jdo.annotations.Embedded

Annotation to define that the object is embedded into the table of the owning object.(Annotation of JDO)

 
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 ...