|JPA Queries with Historical Session [message #819249]
||Mon, 12 March 2012 17:15
| Alfredo Osorio
Registered: March 2012
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?
[Updated on: Fri, 12 December 2014 17:00]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01327 seconds