I'm having two tables
First plan_time
NAME | START_FK | END_FK
------------------------
test | 1 | 2
start_fk and end_fk are FK refering to table times :
ID | NAME
---------
1 | time1
2 | time2
I'm executing simple select query:
SELECT pt.*, t1.*, t2.* FROM plan_table pt LEFT JOIN times t1 ON t1.id = pt.start_fk LEFT JOIN times t2 ON t2.id = pt.end_fk
And here is the problem. Under sql console I'm getting good result:
First row from plan_table join by first row from times table and second row from times table.
When I'm doing that via hibernate
SQLQuery sqlQuery = s.createSQLQuery( SQL-QUERY )
.addEntity(PlanTime.class)
.addEntity(Times.class)
.addEntity(Times.class);
I'm getting 3 objects
It have to be something with Hibernate... I checked SQL which is send to DB and it is ok.
:/
Please help.
I found workaround for this problem. Here are tips which helped me:
I'm still trying to find out what is status of this issue.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.