Is it possible to execute a JPQL using a HistoricalSession instead of the EclipseLink query language?
Right now I'm forced to do queries like this:
JpaEntityManager jpaEntityManager = entityManager.unwrap(JpaEntityManager.class);
ClientSession clientSession = jpaEntityManager.getServerSession().acquireClientSession();
AsOfClause asOfClause = new AsOfClause(date);
Session historicalSession = clientSession.acquireHistoricalSession(asOfClause);
ReadAllQuery historicalQuery = new ReadAllQuery(Employee.class);
List<Employee> employees = (List<Employee>)historicalSession.executeQuery(historicalQuery);
I would like to do something like:
String jpql = "select e from Employee e";
List<Employee> employees = entityManager.createQuery(jpql, Employee.class).getResultList();
instead of using the ReadAllQuery and still be using the Historical Session.
Is it possible?
If it is not possible I would like to contribute to implement it. Can someone tell me where to start?
Regards,
Alfredo Osorio
Shows Infantiles
[Updated on: Fri, 12 December 2014 12:00] by Moderator