Hello !

You must explicitly initialize your object before returning it to your webapp !
You can do this just with calling the size() method of your collection !

Of course it would be easier if you use the Facade Pattern with a Session Bean !

for example (in the session bean)


  | public Employee findEmployee(int id) {
  |      Employee employee = employeeDao.findEmployeeById(id);
  |      // this line initialize address collection
  |      // be careful if the collection == null !!!
  |      employee.getAddress().size(); 
  | }
  | 

I hope it would be easier for you ;)

Good luck

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3917544#3917544

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3917544


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to