About named queries

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.   #1 2015-12-25 16:13 I have an OrderData class, containing an OrderItemData collection, i would like to find OrderData elements by Ord ...

 
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: ... Is there a way to run native SQL queries in ObjectDB? I would guess 'no' since it is an oodbms, ... 12:20 Native SQL queries are not supported because there is no underlying RDBMS. But since SQL ...

 
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: ... bug (so no need to repair it with the Doctor) but various queries can fail with versions of ObjectDB before the new build. Note ... database files, memory usage of the JVM and efficiency for queries. We already need the key before the entities are persisted so ...

 
forum_thread

Querys without Transaction

Hello, are querys faster, if we use the entity manager without transaction, since we need only read-only entities. ... There is no much difference, but report queries , i.e. queries that return simple value fields rather than entity objects are more ...

 
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: ... and @Temporal(TemporalType.TIMESTAMP). I test the queries: Query query = em . createQuery ( "SELECT c FROM Cdr ...

 
api-jpa

getParameter(name)

Get the parameter object corresponding to the declared parameter of the given name.(Method of javax.persistence.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: #1 2014-08-22 11:45 Hi I would know if this type of query is supported By JPA: SELECT sum ( nb1 ) , ...

 
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: #1 2013-03-20 15:30 Hi, what is the correct syntax for IN operator when list of literals ia used instead of parameter, e.g. ...

 
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. #1 2015-07-12 19:18 Hi, For the purpose of some charts on a dashboard for our ERP i would like to get the list of countries a ...

 
forum_thread

java.lang.ClassCastException in query results

I have a simple object stored in a ObjectDb file Stadium Name (java.lang.String) Capacity (int) City (java.lang.String)   When i run the following code i get the ClassCastException in the "for (Stadium result : results)" line #1 2014-08-10 18:12 I have a simple object stored in a ObjectDb file Stadium Name (java.lang.String) Capa ...