About named queries

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

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

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

 
api-jpa

getParameter(name)

Get the parameter object corresponding to the declared parameter of the given name.(Method of javax.persistence.Query)

 
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

Query for objects persisted within the same transaction

I have a question concerning reading uncommited entities with query, within active transaction. For example, I read data from file. Each line contains value of one of entity's attributes but those values are not unique, so it's possible to have a multiple instances of the same entity. To eliminate duplicates, after reading every line I first check using a query, if an entity with that attribute value already exists. If no - I create one and persist it.... withing current transaction is invisible to future queries in this transaction, unless I do commit. The ugly solution is to use ...

 
forum_thread

Criteria Query results in a NoResultException instead of returning object

When I run the following code    ... improve performance and to make using entity objects in queries easier). Please try build 2.4.4_04 that should fix this ...

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

 
issue

Incorrect entity returned by query

Hello, during the analysis of a bug in our program we found an issue with a query that does not return the expected entity. We have attached the corresponding database. The query is: SELECT dep FROM UsedInDependency AS dep WHERE dep.sheet.uid == '317j' AND dep.source.row.q + dep.source.row.offsetEntry.offset >= 1 AND dep.source.row.q + dep.source.row.offsetEntry.offset <= 1 AND dep.target.row.q + dep.target.row.offsetEntry.offset > 1   Bug Version: 2.7.2 Priority: Critical Status: Fixed Replies: 1 Type:  Bug ...