Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Databases > Hibernate: @Sec...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 3705 of 3747
Post > Topic >>

Hibernate: @SecondaryTable causes ORA-00918

by ralph <ralph.peterson@[EMAIL PROTECTED] > Apr 14, 2008 at 07:07 AM

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 @[EMAIL PROTECTED]
 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




 1 Posts in Topic:
Hibernate: @SecondaryTable causes ORA-00918
ralph <ralph.peterson@  2008-04-14 07:07:34 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue May 13 23:18:43 CDT 2008.