From: <no...@at...> - 2005-05-27 13:24:32
|
The following comment has been added to this issue: Author: Stephen Earl Created: Fri, 27 May 2005 8:23 AM Body: Forgot to mention that what is being passed in in my Order object is this: Order.asc("artist.name") --------------------------------------------------------------------- View this comment: http://opensource.atlassian.com/projects/hibernate/browse/HHH-545?page=comments#action_17959 --------------------------------------------------------------------- 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: Unassigned Priority: Major 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 8:23 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 |