About WHERE

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

 
page

Privacy Policy

... to use it. The policy sets out the different areas where user privacy is concerned and outlines the obligations & requirements ... to better the users experience while visiting the website. Where applicable this website uses a cookie control system allowing the user on ...

 
forum_thread

NOT NULL not working

I added a OneToOne Realtionship to one of my entity classes. To  give this field a value in my existing datasets i wrote an upgrade method. The cool thing is that SELECT u FROM Unit u WHERE u.lastPosition IS NOT NULL returns no datasets. Is this a bug or am i missing something? ... cool thing is that SELECT u FROM Unit u WHERE u . lastPosition IS NOT NULL returns no ... Try this query: SELECT FROM Unit u WHERE u . lastPosition IS NULL ...

 
forum_thread

Group by date / time

Hi, I'm trying to create reporting query that will return entities grouped by year / mont / day. Each entity has it's own field that holds java.lang.Date. There is no function like YEAR(), MONTH() or DAY() in ODB. So, how to build queries similar to something like this: SELECT COUNT(id) FROM stats WHERE YEAR(record_date) = 2009 GROUP BY YEAR(record_date), MONTH(record_date) or maybe something like this: ... SELECT COUNT ( id ) FROM stats WHERE YEAR ( record_date ) = 2009 GROUP BY YEAR ... SELECT COUNT ( id ) FROM stats WHERE YEAR ( record_date ) = 2009 GROUP BY ...

 
forum_thread

Performance in large transactions

Hello, we have a performance problem when we use a large transaction. Let's do exactly the same in several transactions the ObjectDB works much faster. In our use case, we create many new entities and between the creations we call a select query. The execution of the query becomes slower at each iteration. (In the query, we search for an item of type Entity2. However, there is only one entity.)   Pseudocode for the fast and the slow solution FAST: ... = //query (getSingleResult): "select e from Entity2 e where e.start <= "+i+" AND "+i+" <= vec.end"   ... = //query (getSingleResult): "select e from Entity2 e where e.start <= "+i+" AND "+i+" <= vec.end"   ...

 
issue

Problem with JOIN and inheritance

Hello, Please run this query on the attached DB: SELECT DISTINCT $1 FROM com.quasado.serviceplaza.customer.VendorCustomer $1 JOIN $1.qubletFRAGMENTMAP $2, com.quasado.foundation.warehouse.contract.customer.CustomerContractsFragment $3 WHERE ((NOT (($2=$3) AND ($3.contracts IS EMPTY)))) The problem is quite easy: The "VendorCustomer" class inherits from the "Customer" class. ... contract . customer . CustomerContractsFragment $3 WHERE ( ( NOT ( ( $2 = $3 ) AND ... also selecting all "Customer" classes which fullfill the where requirements. This seems to be clearly wrong to me because I should not ...

 
forum_thread

100% CPU when using multiple BETWEEN

Hi, we are evaluating ObjectDB 2.5.1_03 in embedded mode. We have a DB of about 2800 instances of a class that has two java.lang.String members: toExtension and fromExtension. There are other members in the class, but not relevant to the problem.   A query like this cause the java process to start running at 100% CPU (endless loop) and it never recovers: ... SELECT r FROM RecordingMetaData AS r WHERE ( ( ( r . toExtension BETWEEN '2010' ... SELECT r FROM RecordingMetaData AS r WHERE ( ( ( r . toExtension BETWEEN '2010' ...

 
api-jpa

getRestriction()

Return the predicate that corresponds to the where clause restriction(s), or null if no restrictions have been specified.(Method of javax.persistence.criteria.AbstractQuery)

 
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

selecting objects that have a particular key/value in persistant HashMap

Hi, First post here and exploring ObjectDB.  I have an class Person which has a HashMap<String, String> called 'pMap' as a persistable field.  I am able to create Person objects and persist them as expected. ... (but clearly does not work) :  SELECT p FROM Person p where p.pMap['location']='California' Any ... following query: SELECT p FROM Person p WHERE p . pMap . get ( 'location' ) = 'California' ...