[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-2873) composite id not delimited properly in the projection of a subquery
Diego Pires Plentz (JIRA)
noreply at atlassian.com
Sat Oct 20 12:09:38 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-2873?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Diego Pires Plentz resolved HHH-2873.
-------------------------------------
Assignee: Diego Pires Plentz
Resolution: Duplicate
> 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
> Assignee: Diego Pires Plentz
>
> 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: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the hibernate-issues
mailing list