About query

issue

Different behavior for two equal queries

Hi, I've got two equal queries though they behave differently: SELECT FROM com.quasado.foundation.communication.contact.individual.IndividualContact $1 WHERE (($1.organisation.name LIKE '%Q%')) This correctly returns one entry from my database ... plans from the explorer if that helps: First query (which works): Query Plan Description ====================== Step 1: Process ... selection and prepare final results. Second query (which fails): Query Plan Description ====================== Step ...

 
forum_thread

Query in JPA2 with LEFT JOIN on INNER JOIN

select a.description, a.id, p1.description, p2.description,p3.description from action a left join action_profile ap1 on ap1.id_action=a.id inner join profile p1 on  ap1.id_profile=p1.id  and p1.name='?' left join action_profile ap2 on ap2.id_action=a.id inner join profile p2 on  ap2.id_profile=p2.id  and p2.name='?' where a.id =?;   Thanks   ... 13:29 How write a query in JPA2 with LEFT JOIN on INNER JOIN? SELECT a . description ... in the WHERE clause. But actually your query may indicate that you model is not optimized for JPA. Instead of ...

 
forum_thread

Sorting problem

Hi, I was rewriting our DAO to support pagging in large dataset and I think I have found a problem with sorting. I send you a test case - sorry for using the same project as previous, but it was faster to write this test case. As usual, you can load data with DataLoader and then check problem with QueryData. There is a simple query with "order by" sentence: ... check problem with QueryData. There is a simple query with "order by" sentence: List<Branch> prodList = ... ( 1 , "br.id" ) ; This query should return all the branches sorted descending, but I get this result: ...

 
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. ... get over is, even with all the classes loaded, an untyped query: List result = em. createQuery ( queryString ) ... incorrect. explorer executes a user's JPQL query and it certainly doesn't have my object model available to it. does ...

 
forum_thread

Criteria Query results in a NoResultException instead of returning object

When I run the following code    ... ( ) ; which evaluates to the query: SELECT $1 FROM IdentityObject $1 WHERE $1 . name = ... No matching results for a unique query at ... No matching results for a unique query at com.objectdb.o.JPE.g(JPE.java:100) at ...

 
forum_thread

Entity Type is not found (error 301) in Query

Overall test OpenJPA, HibernateJAP, EclipseLink and ObjectDB. No Problem with OpenJPA, HibernateJAP, EclipseLink For ObjectDB there is one query in following method, where the full qualified class name is necessary. See method code - red part Otherwise an error will occure. ... EclipseLink For ObjectDB there is one query in following method, where the full qualified class name is necessary. ... at.sciencesoft.db.jpa.DAOjpa.query(DAOjpa.java:326) at ... strange, because in the same method - other workflow - the query works with the simple class name. Breaking down the code for simple ...

 
forum_thread

Several parallel threads to speed up query on one DB

Hi, I have an application: producer (from a DB) to a consumer. The current bottleneck is the producer from DB (based on a query) and I would like to speed it up. I have tried using several entity managers (same DB instance) to benefit from the parallelisation - but it looks like I don't get much benefit from doing that.  ... The current bottleneck is the producer from DB (based on a query) and I would like to speed it up. I have tried using several ... - and it looks like there are some benefits - i.e. each query in a thread is running simultaneously - but it looks sometimes the "query ...

 
forum_thread

Order in WHERE Clause affects behaviour on DATE/DATETIME columns

Quick example:  public class MyClass { @Column(name = "myText") String myText; @Temporal(TemporalType.TIMESTAMP) @Column(name = "myDate") Date myDate; } Now, when querying the db with: ... Now, when querying the db with: Query q = JPA. em ( ) . createQuery ( "SELECT m FROM MyClass m WHERE m.myDate LIKE :query OR m.myText LIKE :query" ) ; q. setParameter ( ...

 
forum_thread

Server closes if large query runs out of memory

We are using ObjectDB in production, and have found what we thing to be a serious problem:  the objectdb server can run out of memory and stop if a query deals with too many objects. This isn't the behaviour we expected for a product that we want to use to deliver 24/7 high-volume data collection. ObjectDB surely has some idea of the sizes of objects that it persists and retrieves, and so should be able to fail safely if it finds too many objects being retrieved to fit into memory. There must be some alternative to crashing! ... objectdb server can run out of memory and stop if a query deals with too many objects. This isn't the behaviour we ... of Java heap space in any scenario. Regarding a query that returns too many objects, consider limiting the number of result ...

 
issue

NullPointer on query

I'm getting a null pointer when running the following code: TypedQuery<ObjectDbMessagePayload> query = em.createQuery("SELECT m FROM ObjectDbMessagePayload m WHERE m.id = :id", ObjectDbMessagePayload.class); query.setParameter("id", msg.getId()); List<ObjectDbMessagePayload> loaded = query.getResultList(); Stack trace follows: ... code: TypedQuery<ObjectDbMessagePayload> query = em. createQuery ( "SELECT m FROM ObjectDbMessagePayload ... = :id" , ObjectDbMessagePayload. class ) ; query. setParameter ( "id" , msg. getId ( ) ) ...