About Criteria API

api-jpa

getLockMode()

Get the current lock mode for the query.(Method of javax.persistence.Query)

 
api-jpa

setLockMode(lockMode)

Set the lock mode type to be used for the query execution.(Method of javax.persistence.Query)

 
forum_thread

multiple LEFT JOINs do not work as expected

Hi, We have a hierarchical data set of organisations in the database, where each organisation stores a reference to it parent organisation. I'm trying to find all organisations 2 levels under a root organisation, e.g. where organisation.parentOrg is the root or organisation.parentOrg.parentOrg is the root. The query also contains a number of other predicates and it is built dynamically using Criteria API. It could be looking for other number of levels, 2 is just an example. The test query looks like this: ... of other predicates and it is built dynamically using Criteria API. It could be looking for other number of levels, 2 is just an example. ...

 
api-jpa

setLockMode(lockMode)

Set the lock mode type to be used for the query execution.(Method of javax.persistence.TypedQuery)

 
api-jpa

javax.persistence.criteria.Order

An object that defines an ordering over the query results.(Interface of JPA)

 
api-jpa

javax.persistence.criteria.Selection

The Selection interface defines an item that is to be returned in a query result.(Interface of JPA)

 
api-jpa

javax.persistence.criteria.Expression

Type for query expressions.(Interface of JPA)

 
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   ... Sorry, but I use Criteria API. edit ...