cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco Mapping File for org.hibernate.Query

joaotpd
Champ on-the-rise
Champ on-the-rise
Hi,

In the class org.alfresco.repo.workflow.jbpm.JBPMEngine, in method getAssignedTasks(String authority, WorkflowTaskState state, boolean sameSession), an org.hibernate.Query is defined like below:




Query query = session.getNamedQuery("org.alfresco.repo.workflow.findTaskInstancesByActorId");




I understand that the "queryName" parameter of "getNamedQuery" is defined externally but, where is the mapping file where is defined??

Can someone point me to documentation that helps me define similar queries?

Thanks in advance,

João
1 REPLY 1

abarisone
Star Contributor
Star Contributor
Hi,
I followed this path in order to find some info for you:
1) started searching into
tomcat\webapps\alfresco\WEB-INF\classes\alfresco
where all Spring context definitions can be found
2) looking at the
hibernate-context.xml
file I found all the mappings for the
sessionFactoryBase
with their values
3) inspected the last value
org/alfresco/repo/workflow/jbpm/jbpm.ext.queries.hbm.xml

4) finally found the definition on the Alfresco SVN here http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/COMMUNITYTAGS/V4.0d/root/projects/reposi...
5) this mapping in contained in the
alfesco-repository-your_alfresco_version.jar
file

To define similar queries I think you have to build your owm hbm .xml files and put them in the classpath.
I would suggest you to extend Spring Hibernate configuration in order to define them.

Hope this helps.

Regards,
Andrea