-->
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.  [ 4 posts ] 
Author Message
 Post subject: PersistentSet Object Being passed to client war
PostPosted: Wed May 31, 2006 1:46 pm 
Regular
Regular

Joined: Wed Jan 19, 2005 4:52 pm
Posts: 61
Location: Kansas City, USA
Hibernate version: 3.1

We have hibernate sitting behind ejb's and it is looking like the mapping sets are the PersistentSet object, is there a way to get around this and just use the HashSet object so we do not have to include the hibernate.jar file in the client war file. We have the POJO hibernate data objects in our ejb client jar and this is being used in the client war file.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 31, 2006 10:15 pm 
Expert
Expert

Joined: Thu Dec 23, 2004 9:08 pm
Posts: 2008
Use the interfaces, that's what they're for. Use Set, not HashSet or PersistentSet. PersistentSet implements Set, so all will be well.

_________________
Code tags are your friend. Know them and use them.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 01, 2006 11:19 am 
Regular
Regular

Joined: Wed Jan 19, 2005 4:52 pm
Posts: 61
Location: Kansas City, USA
Currently, our domain objects are declared as interfaces

IE..

public class Cat{
private Set kittens = null;

public void setKittens(Set set){ }
public Set getKittens(){ return kittens; }

}

What the problem is, the PersistentSet Implementation is still required on the client side because of serialization across the wire, from our distributed components...

How are other people getting around this??

The only thing we're thinking about doing is having an adapter pattern utility class inside our ejb that introspects the object that is going to be returned to the portal, and convert the hibernate specific impl (PersistentSet) to something like HashSet ?

The other thing that is causing problems (we believe) is that our client portal server is on jdk1.3 and the app server is 1.4.x so we're getting major/minor errors... We believe it's directly related to the hibernate.jar (3.1.x) is it jdk 1.3 compatible ? we've tried distributing the hibernate.jar to the client server to see if that would fix our problem... (even though we shouldn't have to do that) and that's where we're getting the major/minor errors....

Any thoughts, much appreciation.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 01, 2006 6:06 pm 
Regular
Regular

Joined: Mon May 22, 2006 2:30 pm
Posts: 74
You shouldn't be returning results that come directly from the persistence layer to your client. Use the Data Transfer Object design pattern. You need to decouple the two layers.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.