| Author |
@OneToMany returning duplicate collection
|
sachin pachpute
Ranch Hand
Joined: Aug 05, 2004
Posts: 35
|
|
Hi,
I am getting filtered 'Trainer' entities, but collection (trainedMonkeys) is not filtered. 'trainedMonkeys' variable is holding all 'Monkey' objects instead of holding only the one with 'isThumb = true'.
Can someone please check if below criteria I am using is correct?
Trainer.java
Monkey.java
I am executing below code in the controller,
and the output is as below (Text marked in RED is not expected as it is marked as 'isThumb=false' in the database and hence should not be shown. Please suggest...),
<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>
Trainer ID*****88
Trainer Name******TrainerSachin
Monkey ID*****87
Monkey Name*****Monkey_1
Monkey ID*****88
Monkey Name*****Monkey_2
Monkey ID*****89
Monkey Name*****Monkey_3
<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>
<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>
Trainer ID*****89
Trainer Name******TrainerVinod
Monkey ID*****90
Monkey Name*****Monkey_5
Monkey ID*****91
Monkey Name*****Monkey_6
Monkey ID*****92
Monkey Name*****Monkey_7
<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>
|
 |
 |
|
|
subject: @OneToMany returning duplicate collection
|
|
|