-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Multilayer and lazyloading
PostPosted: Mon Apr 18, 2005 2:54 am 
Newbie

Joined: Mon Apr 18, 2005 2:32 am
Posts: 1
Hibernate version: 2.1.7
I'm working on a multi layer app with JBoss/Hibernate.

I found some examples getting children items of an entity with a lazy loading association : i made a business method to reattach the entity to a new hibernate session for getting children --> works fine!

The problem is i found nothing about filling a new hibernate set to create associations for a new entity with lazy loading. I would like to create a business method like that :
Code:
public void setChildrenToEntity(HashSet set,Entity entity)
{
  Session session = HibernateUtils.getHibernateSession();
  session.lock(entity,LockMode.READ);
  net.sf.hibernate.collection.Set children =  new  net.sf.hibernate.collection.Set()
children.addAll(set)
entity.setChildren(children)
}


where am i wrong in my code? what's the best practice?
thanks in advance!


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 11:09 am 
Regular
Regular

Joined: Mon Apr 25, 2005 5:36 am
Posts: 103
Do you have find a solution?

please tell me what


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.