From: Eric C. (JIRA) <no...@at...> - 2006-07-04 18:23:58
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-545?page=comments#action_23533 ] Eric Coupal commented on HHH-545: --------------------------------- Actually, i also need a workaround fort that, i tried to get the sql query string to pipe the orderby but getQueryString doesnt exist in hibernate3. > Hibernate doesn't seem to allow nested properties in an Order object. > --------------------------------------------------------------------- > > Key: HHH-545 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-545 > Project: Hibernate3 > Type: Bug > Components: core > Versions: 3.0.5 > Environment: Hibernate 3.0.5 > JBoss 4.0.2 > MySql 5.0.4 BETA > Reporter: Stephen Earl > Attachments: orderIssue.zip > > > 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? -- 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 |