cancel
Showing results for 
Search instead for 
Did you mean: 

How to make nativesql queries on activit tables

ahmetkara
Champ in-the-making
Champ in-the-making
Hi,

Is there a way to map activiti tables with jpa and run nativesql's on those tables??
4 REPLIES 4

tombaeyens
Champ in-the-making
Champ in-the-making
You can run native sql on the activiti tables.
You can store JPA entities as process variables and Activiti will store references to those entities.

Can you explain a bit more what you mean with "map activiti tables with JPA"?

ahmetkara
Champ in-the-making
Champ in-the-making
Actually I need to run nativesql queries on activiti tables. For example; I want to display a processes which has been started by loggedin user. To do this(as I know), I should query the ActHiProcInst table like this "select a from ActHiProcinst a where  startUserId = (:loggedInUserId)", but this is not met by activiti history api, so I need to query activiti history tables. To do that, I thought I might get the JPA entities by reverse engineering and then I could query tables using JPA entity manager (I don't know it is right way or not). So I am asking how to query acitiviti's own tables by JPA not any persistable entity. I hope, I could be clear Smiley Very Happy. By the way, thanks for reply.

vander230
Champ in-the-making
Champ in-the-making
Hello, Firstly I personally roll backwards. might be a bit harder for some. but quite easy to keep everything in place and trying for these queries.

tombaeyens
Champ in-the-making
Champ in-the-making
You can add a Jira to request a feature that adds the capability to the HistoricProcessInstanceQuery to filter on who started the process instance.

historyService
  .createHistoricProcessInstanceQuery()
  .startedBy("johndoe")
  .list();

Is that what you want?
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.