-->
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: Persistence wrapper classes...
PostPosted: Tue Jul 20, 2004 3:01 pm 
Newbie

Joined: Tue Jul 20, 2004 2:40 pm
Posts: 9
Location: New York, NY
(I'm using Hibernate 2.1)

I'm incorporating Hibernate into the backend of a client-server Swing program. The server has multiple RMI services that query for and pass off objects to the client. I'm currently converting the first service to use Hibernate as a test/proof of concept.

Things are going fairly well on the server side - Hibernate is correctly querying for and generating objects (whee!). I've also written a stand-alone test that doesn't use RMI, and I'm successfully creating objects, modifying, deleting, querying, etc. (So I know my mappings work) However, when I attempt to hand the generated objects off to the client over RMI, I get the following exception on the client side:

WARNING: java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
java.lang.ClassNotFoundException: net.sf.hibernate.collection.List (no security manager: RMI class loader disabled)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:169)

Hibernate seems to be wrapping a java.util.List member variable in my object in it's own class, net.sf.hibernate.collection.List, changing the class at runtime. I suppose I could get around this by just including all the neccessary Hibernate jars in the client, but we really don't want the client to know anything about Hibernate at all (or anything else used behind the scenes on the server).

Is there any mechanism to 'un-wrap' collections (or other data members) that have been wrapped by Hibernate? How have other people addressed this?

thanks!
~kevin


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 20, 2004 3:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
You can use DTOs.

The collection wrapper carries useful information that makes it possible to use detached objects efficiently.


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.