jpql « Eclipse « JPA Q&A

1. Parameter in like clause JPQL

I am trying to write a JPQL query with a like clause: ...LIKE '%:code%' I would like to have code=4 and find 455 554 646 ... I cannot pass :code = '%value%' namedQuery.setParameter("%" + this.value + "%"); because in another ...

2. Workaround for the missing NVL() in JPA 1.0

is there a workaround for the missing NVL() function in JPA 1.0 (Eclipselink 1.1.x)? Thank you and best regards

3. JPQL inconsitency between hibernate and eclipselink

I have the following query that works under Hibernate but not under eclipse:

select o from Organisation o where o.code=:code and o.type=:type
It is not clear to me why this is the case, ...

4. JPA 2 "member of" syntax doesn't work with members of superclass

Basically i have a named query "findServerWithNic" which refuses to work:

@Table(name = "vnm_server")

5. JPA: PersistenceException "unknown state or association field"

I am trying to understand how to do (simple) joins in JPQL. I have two tables/entities: Parent and Child.

@Table(name = "Parent")
    @NamedQuery(name = "Parent.findByStatus", query = "SELECT ...