-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: select with multijoin and fetch
PostPosted: Fri Aug 05, 2005 10:42 am 
Newbie

Joined: Wed May 18, 2005 6:48 pm
Posts: 4
Hello,

Consider this task:
"select category from database for which are products ordered by type name and category name"

Products ( id, name, price, category )
Category ( id, name, type )
Type ( id, name )

Type one-many Category
Category one-many Product

Ok so, I use HQL like:
select distinct category from Product product join fetch product.category category join fetch category.type order by category.typ.name, category.name.

and ... we have problem with multijoin with fetch
Hibernate make good query to database, but it can't fetch object from result because he use different alias in 'making query' and in 'fetching'.
or somethings ...

It throw exception:
org.hibernate.exception.GenericJDBCException: could not execute query
..
..
Caused by: org.postgresql.util.PSQLException: The column name id4_1_ not found.

Greetings
Flower


Top
 Profile  
 
 Post subject:
PostPosted: Fri Aug 05, 2005 10:45 am 
Newbie

Joined: Wed May 18, 2005 6:48 pm
Posts: 4
I try version 3.0.3, 3.0.5 and 3.1.0 ... and everywere is the same, only column name was changing.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.