aspose file tools
The moose likes JSP and the fly likes @OneToMany returning duplicate collection Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » JSP
Reply Bookmark "@OneToMany returning duplicate collection" Watch "@OneToMany returning duplicate collection" New topic
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

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



 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: @OneToMany returning duplicate collection
 
Similar Threads
Value is not reflected in the language drop down while calling the ejb bean in the modify user
problem calling static method using OGNL
How can we set integer or other type values in standard action jsp:useBean...jsp:setProperty?
iterate problem in struts2
Getting Exception creating bean of class JSP Exception