Message:
The following issue has been closed.
Resolver: Gavin King
Date: Sun, 31 Aug 2003 2:32 AM
The correct syntax is
alias.person.id.compositIdProperty = ? and ....
---------------------------------------------------------------------
View the issue:
http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HBI-9
Here is an overview of the issue:
---------------------------------------------------------------------
Key: HBI-9
Summary: Not being able to query using an object
Type: Bug
Status: Closed
Priority: Major
Resolution: REJECTED
Project: Hibernate 1.2
Assignee:
Reporter: abe zafar
Created: Mon, 18 Aug 2003 8:11 PM
Updated: Sun, 31 Aug 2003 2:32 AM
Description:
I have two classes Event and Person and I want to query event based on a Person. I was hoping I would be able to do this:
String query = "from com.rhi.domain.impl.Event as event where event.person =?"
Since Event is related to Person by a many-to-one relationship I thought Hibernate could create the right sql from the above query.
<many-to-one name="person" class="com.rhi.domain.impl.Person">
<meta attribute="property-type">com.rhi.domain.Person</meta>
<column name="person_id"/>
<column name="person_region_id"/>
</many-to-one>
But it didn't work and I had to do this:
String query = "from com.rhi.domain.impl.Event as event where event.personId = ? and event.personRegionId = ?";
and I also had to add separate mappings for the ids as such so that the query would work:
<property name="personId" column="person_id" type="java.lang.Long"/>
<property name="personRegionId" column="person_region_id" type="java.lang.Long"/>
I wasn't sure if this was a bug or a new feature. If this is a new feature are there plans to implement it?
---------------------------------------------------------------------
JIRA INFORMATION:
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
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
|