The question is really - how can I get an instance to be marshalled as an
entire object the first time it is placed in an xml document, but as a
reference on all subsequent placements?

Assume the following objects (not in precise, complete Java syntax, but enough
to explain the concept).

Type Person
      field String firstName
      field String lastName
      field String id  // the id uniquely identifies the person

Type Account
      field integer accountNumber  // the accountNumber uniquely identifies the
person
      field Person owner

Assume they have been instantiated as follows:

Person
      firstName = Micky
      LastName = Mouse
      id = abcd

Account
      accountNumber = 1
      owner = the Person instance for Micky Mouse above

Account
      accountNumber = 2
      owner = the Person instance for Micky Mouse above

I would like to have the above objects marshalled into an xml document that
would look roughly like this

...
      <account>
            <accountNumber>1</accountNumber>
            <owner>
                  <firstName>Micky</firstName>
                  <lastName>Mouse</lastName>
                  <id>abcd</id>
            </owner>
      <account>
      <account>
            <accountNumber>2</accountNumber>
            <owner id=abcd></owner>
      <account>
-----------------

I have done some exploring with the identify parameter on the class declaration
and the reference="true" paramenter on the bind-xml field.  I can get every
reference to an instance to be marshalled as an object or every reference to be
marshalled as a reference, but can't get the first to be marshalled as an
object and subsequent ones as a reference.

Can you give me some advice on how that can be done?  I can be reached at
[EMAIL PROTECTED]

Thanks!

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to