]
Emmanuel Bernard moved ANN-662 to HHH-2873:
-------------------------------------------
Key: HHH-2873 (was: ANN-662)
Project: Hibernate3 (was: Hibernate Annotations)
composite id not delimited properly in the projection of a subquery
-------------------------------------------------------------------
Key: HHH-2873
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2873
Project: Hibernate3
Issue Type: Bug
Reporter: Nick Padgett
composite id not delimited properly in the projection of a subquery. This is an issue in
hibernate-3.2.5.ga.
Here is my hibernate mapping file:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="localhost.entity.impl">
<class name="ParticipantImpl" table="EVENT_PARTICIPANT"
mutable="false">
<composite-id name="id" class="ParticipantId">
<key-property name="eventId" type="long"
column="EVENT_ID" />
<key-property name="teamId" type="long"
column="TEAM_ID" />
<key-property name="participantId" type="long"
column="PARTICIPANT_ID" />
</composite-id>
<property name="homeAway" type="string"
column="HOME_VSTR_IND"
length="5" />
</class>
</hibernate-mapping>
Here is my query:
DetachedCriteria detachedCriteria;
Organization organization;
DetachedCriteria orgDetachedCriteria;
detachedCriteria = DetachedCriteria.forClass(EventImpl.class, "e");
organization = eventCriteria.getOrganization();
if (null != organization) {
orgDetachedCriteria = DetachedCriteria.forClass(
ParticipantImpl.class, "p");
orgDetachedCriteria.setProjection(Projections.id());
orgDetachedCriteria.add(Restrictions
.eqProperty("e.id", "p.eventId"));
detachedCriteria.add(Subqueries.exists(orgDetachedCriteria));
}
The subquery ends up looking like:
select this0__.EVENT_ID as y0_this0__.TEAM_ID as y1_this0__.PARTICIPANT_ID as y2_ from
PUBLIC.EVENT_PARTICIPANT this0__ where this_.EVENT_ID=this0__.EVENT_ID
Notice that there are commas missing after "y0_", "y1_", and
"y2_".
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: