It's not a secret anymore!*
The moose likes Object Relational Mapping and the fly likes ID_NAME in two tables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "ID_NAME in two tables" Watch "ID_NAME in two tables" New topic

ID_NAME in two tables

nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
I have that two Tables with Table1 containing ID_NAME as a primary key
and Table2 containing ID_NAME as a normal row
(that means, it s not a primary-key or a foreign-key). I mapped that in common way.

But when I want to get the ID_NAME from Table2, then this failure occurs:

42703: An undefined column, attribute, or parameter name was detected.

But the column ID_NAME is definitly in my database both in Table1 and Table2.

What does this sql-error mean:

The strange thing is, that the database-column is definitly called ID_NAME and not IDNAME (as produced in the failure-message), another point is, that idName is my property in Table2 and not a correlated column to any other tables. However, I have idName in another Table called Table1 in which this property is a common primary key. But I have not association between Table1 and Table2.

What is wrong?

Does anyone know a solution?
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
solved. I have redefine getter/setters.

Now it works.
nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
I agree. Here's the link:
subject: ID_NAME in two tables
Similar Threads
Problem with joining of two tables with Hibernate
one-to-many mapping with table having no primay key
Hibernate: Different Join in Save() and Get()
Problem finding objets with composite key
PreparedStatement error shown