Hibernate version: 3.1.3
Mapping documents:
Code:
<hibernate-mapping default-cascade="none">
<class name="org.sakaiproject.evaluation.model.EvalGroupNodes" table="EVAL_GROUPNODES"
dynamic-insert="false" dynamic-update="false">
<id name="id" type="java.lang.Long" unsaved-value="null">
<column name="ID" />
<generator class="native" />
</id>
<property name="lastModified" type="java.util.Date">
<column name="LAST_MODIFIED" not-null="true" />
</property>
<!-- this should be the node id -->
<property name="nodeId" type="java.lang.String" index="eval_group_nodeid">
<column name="NODE_ID" not-null="true" length="255" />
</property>
<!-- this holds the associated list of eval groups for this node -->
<array name="evalGroups" table="EVAL_GROUPNODES_GROUPS" cascade="all"><!-- all-delete-orphan -->
<key column="ID" not-null="true" />
<list-index column="GROUPS_INDEX" />
<element type="string" column="GROUPS" not-null="true" />
</array>
</class>
</hibernate-mapping>
I need to do a query which will return the "org.sakaiproject.evaluation.model.EvalGroupNodes" which have a specific item in the evalGroups array. I cannot seem to figure out how to get this query to work.
I tried the following HQL:
Code:
select egn.nodeId from EvalGroupNodes egn where ? in egn.evalGroups order by egn.nodeId
but I just get this error (it seems to convert egn.evalGroups into "."):
org.springframework.jdbc.UncategorizedSQLException: Hibernate operation: could not execute query; uncategorized SQLException for SQL [select evalgroupn0_.NODE_ID as col_0_0_ from EVAL_GROUPNODES evalgroupn0_, EVAL_GROUPNODES_GROUPS evalgroups1_ where evalgroupn0_.ID=evalgroups1_.ID and (? in (.)) order by evalgroupn0_.NODE_ID]; SQL state [37000]; error code [-11];
Can anyone help?
-AZ