Paul-

I've been pondering your problem on and off most of the day.  Recently
someone else had a different problem also related to the CGLIB
proxies, so there may be some merit in looking into them.

Just to make sure I understand the problem, the proxy classes have
extra get methods that return objects you don't want to marshal?  And
since Castor validates the mapping file against the real classes, not
the proxy classes, marking the "field" as transient causes a
MappingException?

I'll try to think about it a little and see if we can find a simple solution.

Stephen


On 3/2/06, Paul Grillo <[EMAIL PROTECTED]> wrote:
>
> I have a nasty problem.  Been using Castor for a couple of years for all our
> classes.  Basically we have a large set of mapping files that generally use
> auto-complete="true" and we specify what is transient.
>
> We are now implementing Hibernate to perist.  However, when we load up an
> object from the DB and then go to marshal it we see the following problem.
>
> Hibernate uses CGLIB and proxies for the class.  At run time there is a
> "getxxxx" that returns an object that we definately do not want to marshal.
>
> So, i can'd set it transient because Castor complains that it cannot find it
> in the unproxied/mapped class.
>
> It will be a large problem for us to crawl through all our mapping files and
> specify each attribute for mapping.  Is there a way around this?
>
> Are there any hooks in Castor where i can indicate to it to not marshal a
> particular attribute?  Any code i can inject any where to handle this?
>
> thanks.
>
> oh,  the decision to use Hibernate has been made.  Not sure i can switch to
> anything else at this point.

Reply via email to