openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick Curtis <>
Subject Re: Query using timestamp version field
Date Tue, 01 Mar 2011 22:16:27 GMT
Can I have you post your Entity? This seems to work with my unit test:

public class TimestampedEntity {
    private long id;

    private Timestamp version;

        EntityManager em = emf.createEntityManager();
        String pql = "SELECT s FROM TimestampedEntity s WHERE s.version <
        Query queryObj = em.createQuery(pql);
        Timestamp t1 = new Timestamp((new Date()).getTime());
        queryObj.setParameter("endDate", t1);
        List<TimestampedEntity> scenarioList = queryObj.getResultList();


On Tue, Mar 1, 2011 at 3:58 PM, kostellodon <>wrote:

> I'm doing this query within a unit test, and am using runtime enhancement
> via
> the javaagent.
> I've tried this with both 1.2.2 and 2.1.0 and see the same index out of
> bounds exception in both cases.
> Either querying another timestamp field or removing the version annotation
> from the update field causes the exception to go away.  Marking a field
> that
> is a Long as the version field also makes it go away, so it appears to be
> directly related to querying against a Timestamp version field.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message