From: <leg...@at...> - 2003-10-22 11:31:05
|
The following issue has been updated: Updater: Sebastien Cesbron (mailto:seb...@la...) Date: Wed, 22 Oct 2003 3:08 AM Comment: Source code of an example with two classes Foo and Bar Changes: Attachment changed to testHibernate.zip --------------------------------------------------------------------- For a full history of the issue, see: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-417&page=history --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-417 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-417 Summary: Criteria API and key-many-to-one Type: Bug Status: Unassigned Priority: Minor Project: Hibernate2 Components: core Versions: 2.1 beta 4 Assignee: Reporter: Sebastien Cesbron Created: Wed, 22 Oct 2003 3:07 AM Updated: Wed, 22 Oct 2003 3:08 AM Environment: Win2k SQLServer with jTds driver Description: I have one class Bar with a primary key composed of a 'key-many-to-one' to a class Foo. I want to find a Bar instance with a Foo id so I have this criteria : Criteria criteria = session.createCriteria(Bar.class); criteria.createCriteria("foo").add(Expression.eq("id", new Integer(1))); Bar bar = (Bar) criteria.uniqueResult(); Then I have this sql statement select this.ID_FOO as ID_FOO0_, this.text as text0_ from BAR this where x0_.id=1 which fails because x0_ isn't defined. With an HQL query it works. --------------------------------------------------------------------- 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 |