Hi
I`m looking for help with my small problem, but I couldn`t find any example in web.
I`ve got two tables
Dictionary
(
key_id number,
dictionary_code string,
key_value string
)
and for example
Product
(
id number,
color_id number,
something..
)
In Dictionary table I have values for many of my dictionares. Unfortunatelly key_id isn`t unique and it can`t be treated as primary key
So row may look like:
1 ; COLOR ; blue
2 ; COLOR ; green
1 ; SIZE ; big
etc
the table Product contains column color_id which references key_id column.
So the question is - how can I define this relation using Hibernate Annotations - so that Product class will have it`s related color value ?
I was trying to define class for that composite key, but i can`t find a way to define a constant value for the dictionary_code field
PS. I can`t change the database structure because it isn`t mine product and idea..
Thanks very very much
Regards
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html