Hi Josh,
I needed to send my objects over SOAP as well (though using GLUE, not Axis). What I ended up doing was write a custom serializer/deserializer that would write my hibernate data objects to and from XML. When I want to send the object over the wire, it is serialzed to XML, and then on the client side it deserialzed back into it's object state. Doing it this way means that I have fine control over how much of the data hibernate lazily loads, meaning it only loads what I want it to send over the wire.
The methods that are exposed with SOAP just send byte arrays around, and there is an API that wraps those methods that to handle the deserialization/serialization. Doing it this way allowed me to avoid having to add special "DTO" objects into my model.
Regards,
Jon...
-----Original Message-----
From: Josh Rehman [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 07, 2003 2:46 AM
To: [EMAIL PROTECTED]
Subject: [Hibernate] Moving Hibernate objects with SOAP
Hello all,
I'd like to move Hibernate generated objects (generated with hbm2java,
of course) across the wire with SOAP.
There are two problems:
First, Hibernate generates collection accessors. This is great, but
these are, by necessity, untyped. The Axis serializer cannot handle this.
Second, it often comes to pass that we are only interested in a subset
of the object. In particular, we often do NOT want to move an entire
collection accross the wire. Unfortunately, the serializer will call all
accesors on the hibernate object, and CGLIB will, of course, do it's job
and get everything known about that object.
We have so far tried to solve these problems by writing an additional
code generator that creates so-called "Data Transfer Objects" (Fowler's
term, also abreviated DTO) that have a) typed array accessors, and b)
the ability to specify a subset of interesting properties. We aren't
quite done with this effort, but it's so far working out well. The DTOs
are generated by delegating work to an underlying hibernate class.
Has anyone faced and solved, these probelms? If so, I'd like to hear
about it. In particular, I was hoping that there is something obvious
that I may have missed.
With kind regards,
Josh Rehman
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
hibernate-devel mailing list [EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel