Welcome to dbFreaks.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Hibernate: @SecondaryTable causes ORA-00918

 
   Database Help (Home) -> Java RSS
Next:  trouble connecting to mysql  
Author Message
ralph

External


Since: Apr 14, 2008
Posts: 1



(Msg. 1) Posted: Mon Apr 14, 2008 7:07 am
Post subject: Hibernate: @SecondaryTable causes ORA-00918
Archived from groups: comp>lang>java>databases (more info?)

I have to tables 'first' and 'second':

CREATE TABLE first (
first_id int IDENTITY NOT NULL,
first_value INT NOT NULL,
PRIMARY KEY (first_id)
)

CREATE TABLE second (
second_id int IDENTITY NOT NULL,
first_id int NOT NULL,
second_value INT NOT NULL,
PRIMARY KEY (second_id)
)

I want to join these two tables into one entity using @SecondaryTable.
The columns that are used for joining are named the same in both
tables ('first_id'). Hibernate creates a query like this:

SELECT f_.first_value as first_value_,
s_.secondValue as second_value_
FROM first f_,
second s_
WHERE f_.first_id=s_.first_id(+)
and first_id=?

In the last line Hibernate "forgets" to add a qualifier to 'first_id',
so I get an "ORA-00918: column ambiguously defined" error.

Any ideas?

Thanks,
Ralpe

 >> Stay informed about: Hibernate: @SecondaryTable causes ORA-00918 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
To hibernate or not to hibernate? - Hello everyone, newbie here. I'm developing an application for a repair shop. Customer comes in with a product, gets registered and a receipt is printed out. I did it on Access five years ago and it's been working since then. But now I want to add a few....

Need some in Hibernate - Hello there, I am new in Hibernate. I look at some examples in Hibernate 3.2 There is ALWAYS a Long id in a table class, like public class State { private Long id; // no such column in my STATE table in database private String state_code; //....

Hibernate and log4j config under Tomcat. - "Under Tomcat 3.x and 4.x, you should place the log4j.properties under the WEB-INF/classes directory of your web-applications. Log4j will find the properties file and initialize itself. This is easy to do and it works." "The XML configu...

Hibernate + Tomcat - where to bind the session to? - Hello group, I am building a web application with Tomcat and Hibernate as O/R mapper. Now my question is where should I bind the session to? At the moment I have the Hibernate Session as a ThreadLocal, so for each thread a new HibernateSession is..

Struts/Hibernate and date troubles - Dear all, I'm getting squeezed between Struts and Hibernate when I use Date type for a record. My setup is the simplest possible. This is my mappings file <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-mapping PUBLIC ..
   Database Help (Home) -> Java All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]