From: <no...@at...> - 2005-05-27 16:14:35
|
The following comment has been added to this issue: Author: Stephen Earl Created: Fri, 27 May 2005 11:12 AM Body: Gavin, First, can you point me to the place in the documentation that states that this is the behaviour to expect? Second, is this something that you would like to get working in the Hibernate product? I ask because I have some cycles to work on this issue and wonder if it would be useful functionality for Hibernate? --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HHH-545?page=comments#action_17967 --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/browse/HHH-545 Here is an overview of the issue: --------------------------------------------------------------------- Key: HHH-545 Summary: Hibernate doesn't seem to allow nested properties in an Order object. Type: Bug Status: Closed Priority: Major Resolution: REJECTED Original Estimate: Unknown Time Spent: Unknown Remaining: Unknown Project: Hibernate3 Components: core Versions: 3.0.5 Assignee: Reporter: Stephen Earl Created: Fri, 27 May 2005 8:17 AM Updated: Fri, 27 May 2005 11:12 AM Environment: Hibernate 3.0.5 JBoss 4.0.2 MySql 5.0.4 BETA Description: When passing "nested" properties in an Order expression a QueryException is thrown stating: could not resolve property: artist.name of: ami.server.dto.AlbumDTO. My mapping files are below: <album.hbm.xml> <hibernate-mapping package="ami.server.dto"> <class name="AlbumDTO" table="calliope.albums"> <id name="id" column="id"> <generator class="native"/> </id> <property name="title" column="title" not-null="true"/> <property name="upc" column="upc" not-null="true"/> <many-to-one name="artist" column="artist_id" class="ArtistDTO" fetch="join"/> </class> </hibernate-mapping> <artist.hbm.xml> <hibernate-mapping package="ami.server.dto"> <class name="ArtistDTO" table="calliope.artists"> <id name="id" column="id"> <generator class="native"/> </id> <property name="name" column="name" not-null="true"/> <property name="searchName" column="search_name" not-null="false"/> </class> </hibernate-mapping> The full source code of the method being called is below: public List<AlbumDTO> findOrderBy (AlbumDTO obj, Order[] orderBy) throws Exception { Criteria criteria = HibernateUtil.getSession().createCriteria(AlbumDTO.class); criteria.add(Example.create(obj)); for (int i=0; i<orderBy.length; i++) { criteria.addOrder(orderBy[i]); } return criteria.list(); } Should this functionality work in Hibernate 3.0.5? Is it a bug? --------------------------------------------------------------------- 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 |