-->
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: Sql error
PostPosted: Wed Jul 20, 2011 6:19 pm 
Newbie

Joined: Wed Jul 20, 2011 6:13 pm
Posts: 1
****************
resolved ... sorry (typo)
****************
Hello

i'am trying a request with 4 join and i got this error

The request :

String sql= " From AlerteSeasonsItunesPrices a , UserListTvShow u , Season s , SeasonItunesPrice sip ";
sql += " Where id_sip = sip.id ";
sql += " and id_season = s.id ";
sql += " and s.id_tvshow = u.id_tvshow ";
sql += " and id_user = 1";


Here my sql table
alerte_season_price(id , price_after, price_before, id_sip)
season_itunes_price(id ,... , id_season)
season(id , name , id_tvshow)
user_list_tvshow (id , id_tvshow , id_user)

if i use " and s.id_tvshow = u.id_tvshow ", i got the error
org.hibernate.QueryException: could not resolve property: id_tvshow of: com.nsa.n74.tvshowtrackerweb.hibernate.Season

if i use " and id_tvshow = id_tvshow ", i got the error
java.sql.SQLException: Column 'id_tvshow' in where clause is ambiguous


i'am quite sure i'am missing something, but i canno't find it

thanks for your help
Nicolas


Top
 Profile  
 
 Post subject: Re: Sql error
PostPosted: Fri Jul 22, 2011 5:43 pm 
Newbie

Joined: Fri Jul 22, 2011 5:04 pm
Posts: 8
Can you also post your mappings? It looks like you probably forgot to map the id_tvshow column, or maybe there is a typo in your mapping somewhere.


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.