on 05-18-2010 3:28 PM
Hi all,
in my project I have two jpa entity classes:
Employee is in a ManytoOne relationship with Company.
Using NWDS tools this has been mapped using @JoinColumn annotation.
Next I have generated tables from entities using NWDS.
In my dictionary project everything looks fine: Employee table has a Company_id field, referring to Company id field.
Unfortunately when I try to use the entity manager after deploying ear and dictionary I get:
Caused by: java.lang.RuntimeException: The persistence unit is inconsistent with the database schema:
Error on attribute >>my.test.Employee.company<<: The column >>EMPLOYEE.company_id<< does not exist.
However the column is actually there in the dictionary project. Deployment is succesful.
I have tried to change names, restart, redeploy whatever but to no use.
Can anyone help?
Thanks, regards
Vincenzo
Hi Vincenzo,
it can be a problem of upper/lower case (Company_id / company_id). You might have to explicity annotate the name of the column in lower (or complete upper) case in the @JoinColumn-annotation.
If it does not help: Which database? Did you check the column exists in the db? Can you post the src?
Greetings
Rolf
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.