I was looking that in the trunk but I don't see nothing strange about persistence there..
I can host a project that has the persistence configuration work if you want.
but my maven deps are:
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-persistence-jpa</artifactId>
<version>5.1.0.SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-workitems</artifactId>
<version>5.1.0.SNAPSHOT</version>
</dependency>
and in my META-INF directory I have the following orm.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm orm_1_0.xsd"
version="1.0">
<named-query name="ProcessInstancesWaitingForEvent">
<query>
select
processInstanceInfo.processInstanceId
from
ProcessInstanceInfo processInstanceInfo
where
:type in elements(processInstanceInfo.eventTypes)
</query>
</named-query>
<!--named-query name="VariableInstancesInfoByProcessId">
<query>
select
v
from
VariableInstanceInfo v
where
v.processInstanceInfo.id = :processId
</query>
</named-query-->
</entity-mappings>
Greetings.
Hi, I'm trying to get persistence working in Drools 5.1.0.M2. I read
through the documentation and the drools-user forum posts and made some
progress but I'm stuck at:
SEVERE: Error in named query: ProcessInstancesWaitingForEvent
org.hibernate.QueryException: cannot dereference scalar collection
element: name [select processInstanceInfo.processInstanceId from
org.drools.persistence.processinstance.ProcessInstanceInfo
processInstanceInfo where :type in (processInstanceInfo.eventTypes.name)]
Here are the steps I've followed so far:
1. Read the documentation and cut and pasted the code to run and persist
a small sample ruleflow. I got the following exception:
Caused by: org.hibernate.AnnotationException: Use of @OneToMany or
@ManyToMany targeting an unmapped class:
org.drools.persistence.processinstance.ProcessInstanceInfo.variables[org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo]
2. Read through the forum and added the following lines to the
persistence.xml file:
<class>org.drools.persistence.processinstance.variabletypes.VariableInstanceInfo</class>
<class>org.drools.persistence.processinstance.variabletypes.JPAPersistedVariable</class>
I got the following exception:
Caused by: java.lang.IllegalArgumentException: Named query not found:
ProcessInstancesWaitingForEvent
3. Read through the forum again and the only thing I found was a post
saying to make sure that the orm.xml with the named query was in the
META-INF directory in the drools-persistence-jpa.jar. I checked and the
orm.xml with the named query was in the
drools-persistence-jpa-5.1.0.M2.jar. I tried copying the orm.xml into a
META-INF directory in my classpath and I got the following exception:
SEVERE: Error in named query: ProcessInstancesWaitingForEvent
org.hibernate.QueryException: cannot dereference scalar collection
element: name [select processInstanceInfo.processInstanceId from
org.drools.persistence.processinstance.ProcessInstanceInfo
processInstanceInfo where :type in (processInstanceInfo.eventTypes.name)]
I'm stuck at this point. It looks like the orm.xml is not in sync with
the Drools 5.1.0.M2 code. I'm sure that someone must have this working.
If so, could you post the orm.xml file that you are using or give me a
pointer as to where I might be going wrong?
Regards,
Rory
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users