About query

forum_thread

Problem of query With an aggregate function

Hi I would know if this type of query is supported By JPA: select sum(nb1), sum(nb2), sum(nb3) from table If yes I have this methode that return a list of Long: ... Hi I would know if this type of query is supported By JPA: SELECT sum ( nb1 ) , sum ... ( Choix choix ) { Query listClassRepHost = em. createQuery ( "SELECT ...

 
forum_thread

IN operator syntax

Hi, what is the correct syntax for IN operator when list of literals ia used instead of parameter, e.g. SELECT FROM Info i WHERE i.status IN (1,4) ? (Suppose status is int.) I always get this exception: SELECT FROM Info i WHERE i.status IN (1 ==> , <== 4) javax.persistence.PersistenceException Unexpected query token ',' (closing ')' is missing) (error 752)   Query with only one item in list works fine: ... javax.persistence.PersistenceException Unexpected query token ',' (closing ')' is missing) (error 752)   Query with only one item in list works fine: SELECT FROM Info i ...

 
forum_thread

Getting sales quantity per country with a query, an idea anyone?

Hi, For the purpose of some charts on a dashboard for our ERP i would like to get the list of countries and the sales quantity for each of them. I am pretty sure it is somehow possible to get that directly from a more or less complex query but i failed to find it; Does any have an idea? The entity (we call it OrderData) contains fields and other entities related to an order, fields we are interrested in are  buyerCountry and orderPrice. ... possible to get that directly from a more or less complex query but i failed to find it; Does any have an idea? The entity (we ... be able to retrieve that information using a GROUP BY query . ObjectDB Support ObjectDB - Fast Object ...

 
forum_thread

query on calendar class

Hello!   I'm looking for help to build query on calendar class. I need to get objects where Calendar.DAY_OF_WEEK is FRIDAY or any other. My class: @Entity public class Cdr {     private static final long serialVersionUID = 1L;        @Id @GeneratedValue     private long serialID;     private String A;     @Temporal(TemporalType.TIMESTAMP) private Calendar start; I tested: ...   I'm looking for help to build query on calendar class. I need to get objects where Calendar.DAY_OF_WEEK is ... private Calendar start ; I tested: Query query = em . createQuery ( "SELECT c FROM Cdr c where ...

 
forum_thread

"where in" query

Is it possible to run a query selecting values that exist in a provided list? e.g. something like: SELECT u FROM User m WHERE u.username IN ('test_user','anotheruser') I've tried various combinations of this including passing the list as a named parameter but without any joy. The only similar examples I can find in the docs involve a join query - but my list isn't in the database - and the MEMBER OF operator doesn't seem to do what I want (although I may be using it incorrectly! ... Is it possible to run a query selecting values that exist in a provided list? e.g. something like: ... similar examples I can find in the docs involve a join query - but my list isn't in the database - and the MEMBER OF operator ...

 
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: ... Hello, we get when executing a query with MEMBER OF on a large list the following InternalException: ... ... more see attached Image ) Our query looks like this: String recordClassName = CoverageRecordImpl. ...

 
forum_thread

native sql queries

Is there a way to run native SQL queries in ObjectDB? I would guess 'no' since it is an oodbms, but I did not find the answer in the documentation. An attempt: Query q = em.createNativeQuery("select * from person"); Result: ... in the documentation. An attempt: Query q = em. createNativeQuery ( "select * from person" ...

 
forum_thread

Querys without Transaction

Hello, are querys faster, if we use the entity manager without transaction, since we need only read-only entities. #1 2017-08-14 14:48 Hello, are querys faster, if we use the entity manager without transaction, since we need only read-only ...

 
api-jpa

JPA Annotations for SQL Queries

Reference (JavaDoc) of JPA 2 sql query annotations.... ObjectDB supports only the preferred JPA query language, JPQL, and silently ignores all the above annotations. ...

 
forum_thread

Query to find object from element of a contained collection

I have an OrderData class, containing an ItemData collection, i would like to find OrderData elements by ItemData.items.itemId. I cant get a proper query with MEMBER OF or IN. Does anyone have an idea on how i could formulate that as Typed or CriteriaBuilder query? Thanks.   ... by OrderData.items.itemId. I cant get a proper query with MEMBER OF or IN. Does anyone have an idea on how i could formulate that as Typed or CriteriaBuilder query? Thanks.   @ Entity public ...