File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@OneToMany returning duplicate collection

 
sachin pachpute
Ranch Hand
Posts: 35
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>



 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic