AnsweredAssumed Answered

Query process instances and JPA entity

Question asked by ollib on Feb 3, 2014
Latest reply on Feb 4, 2014 by trademak
I have a process with a JPA entity "vacation". When I created the process instance, I also create an empty vacation record in the database. The vacation record also stores the associated process instance id.

I also have a process instance search where i can do things like:

List<HistoricProcessInstance> processInstances =
  historyService.createNativeHistoricProcessInstanceQuery()
                .sql("SELECT * FROM " + managementService.getTableName(HistoricProcessInstance.class) +
                     " h, vacations v where h.proc_inst_id_ = v.processinstanceid and v.decision = 'Denied'")
                .list();


As I understand the createNativeHistoricProcessInstanceQuery method, it works with pure SQL.

Would it be possible to make such queries with JPA or Hibernate? I use HibernatePersistence for my vacation objects.

Best regards
Oliver Brüning

Outcomes