Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 2.0.2
-
Component/s: Persistence Layer
-
Labels:None
-
Environment:windows,struts2,hibernate,mysql
Description
I have a entity named salary.
salary is oneToOne user.
if a user has two roles,when I get all of salary,there will be one repeat record.
if a user has three roles,when I get all of salary,there will be two repeat records.
and so on.
attachment is my demo project.
Activity
Matt Raible
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Resolved [ 5 ] |
| Fix Version/s | 2.0.2 [ 10110 ] | |
| Resolution | Fixed [ 1 ] |
The hql is:
select this_.id as id2_2_, this_.salary as salary2_2_, this_.userId as userId2_2_, user2_.id as id0_0_, user2_.account_expired as account2_0_0_, user2_.account_locked as account3_0_0_, user2_.address as address0_0_, user2_.city as city0_0_, user2_.country as country0_0_, user2_.postal_code as postal7_0_0_, user2_.province as province0_0_, user2_.credentials_expired as credenti9_0_0_, user2_.email as email0_0_, user2_.account_enabled as account11_0_0_, user2_.first_name as first12_0_0_, user2_.last_name as last13_0_0_, user2_.password as password0_0_, user2_.password_hint as password15_0_0_, user2_.phone_number as phone16_0_0_, user2_.username as username0_0_, user2_.version as version0_0_, user2_.website as website0_0_, roles3_.user_id as user1_4_,role4_.id as role2_4_, role4_.id as id1_1_, role4_.description as descript2_1_1_, role4_.name as name1_1_ from Salary this_ left outer join app_user user2_ on this_.userId=user2_.id left outer join user_role roles3_ on user2_.id=roles3_.user_id left outer join role role4_ on roles3_.role_id=role4_.id