openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "leonardo kenji shikida (JIRA)" <>
Subject [jira] [Created] (OPENJPA-2569) QBE is not using the right column name in join
Date Tue, 17 Feb 2015 08:15:11 GMT
leonardo kenji shikida created OPENJPA-2569:

             Summary: QBE is not using the right column name in join
                 Key: OPENJPA-2569
             Project: OpenJPA
          Issue Type: Bug
          Components: jpa
    Affects Versions: 2.3.0
         Environment: tomee+ 1.6.0 stable
            Reporter: leonardo kenji shikida

I have a query like this

    public List<E> qbe(E example) {
        OpenJPACriteriaBuilder cb = (OpenJPACriteriaBuilder) entityManager.getCriteriaBuilder();
        CriteriaQuery<E> q = cb.createQuery(clazz);
        Root<E> entity = q.from(clazz);

        q.where(cb.qbe(entity, example)); // query by example;
        TypedQuery<E> tq = entityManager.createQuery(q);
        return tq.getResultList();

for entities like this

public class User implements Serializable{
    private static final long serialVersionUID = 4411272750939441365L;
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;

and this

public class PasswordRotationJob implements Serializable{

    private User submitter;

The QBE query seems to assume a wrong column name

Caused by: org.apache.openjpa.lib.jdbc.ReportingSQLException: ORA-00904: "T1"."USERID": invalid
 {prepstmnt 1347119244 SELECT,(...),, (...),, (...) FROM PasswordRotationJob
t0, APPUSER t1, (...) WHERE (...) AND t0.userId = t1.userId(+) (...)} [code=904, state=42000]

This message was sent by Atlassian JIRA

View raw message