|
|
|
|
|
Issue Type:
|
Bug
|
|
Affects Versions:
|
4.3.10
|
|
Assignee:
|
Unassigned
|
|
Components:
|
hibernate-core, hibernate-entitymanager, query-hql
|
|
Created:
|
18/Jun/2015 07:12 AM
|
|
Environment:
|
Ubuntu Linux 14.04, JDK 8u45, Spring Roo 1.3.1, Maven 3.3.1
|
|
Labels:
|
hql hibernate
|
|
Priority:
|
Major
|
|
Reporter:
|
JohannesMartin
|
|
|
This issue was originally reported in
HHH-6638
which was closed as the issue was not verified with recent versions of hibernate. Unfortunately, the problem still exists.
Test case:
-
create two tables a and b with identical primary keys,
-
add a foreign key to table b referencing the primary key of table a,
-
add some records to the tables,
-
use spring roo (1.3.1.RELEASE) to reverse engineer the table, create JPA entities and MVC,
-
run the generated code in tomcat. On trying to list the contents of one of the tables, the org.hibernate.TypeMismatchException is raised.
I will attach sample DDL and sources to this issue.
Workarounds:
-
use only one primary key class for both tables (but this will not work nicely with roo)
-
change relationship from one-to-one to one-to-many (not verified by myself)
|
|
|
|
|
|