This actually should work now, Mocky, since changes at RC1 where JiBX
started reusing existing object references. I have several test cases
that work with the same object repeatedly, though probably not as
extensively as Siva's example.
Siva, could you try this with the current CVS code to see what happens?
If it still fails, let me know and I'll look into the problem.
- Dennis
Mocky Habeeb wrote:
If you are trying to map one XML structure to multiple Java data structures, I
don't think you're going to be able to do that directly. The mapping is 1 to 1.
Once the first structure ends, it moves on to the next. If you define the same
structure twice, and make them optional, the values will go into the first and
the second one should be empty, because it was optional and wasn't there.
If you want to have multiple references to one object you can use ident="def" and
ident="ref" attributes to define and use a unique id as a reference.
Mocky
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Narayanaswamy,
Sivakumar
Sent: Wednesday, September 21, 2005 4:16 PM
To: [email protected]; [email protected]
Subject: RE: [jibx-users] Unmarshalling, Loosing the scope of the Data
I am using ArrayList for the Collection. The If ia m calling the API for the
first mapping the value is available. If it is mapped in the bind file for the
second time the value is blank.
for ex: bailVO.getDoc() the values are available.
if the same bail.getDoc() is mapped with some other place after its structure
closes, I am loosing the previous value. Do you face same kind problem.
thanks
Siva
-----Original Message-----
From: [EMAIL PROTECTED] on behalf of Mocky Habeeb
Sent: Wed 9/21/2005 03:19 PM
To: [email protected]
Cc:
Subject: RE: [jibx-users] Unmarshalling, Loosing the scope of the Data
It sounds like maybe it's a problem with your collection. Have you tried
it without using the "set-method" and "get-method" attributes in your
collection? What is the actual type for the collection you are using in
Java?
Mocky
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Narayanaswamy, Sivakumar
Sent: Wednesday, September 21, 2005 2:00 PM
To: [email protected]
Subject: RE: [jibx-users] Unmarshalling, Loosing the scope of the Data
When I am doing the Marshalling the BailVO.setDoc() the values are
available in the XML.
when i am calling BailVO.getDoc() for the second set the values are not
available. its blank. I mean for this
<structure get-method="getDoc" set-method="setDoc" usage="optional">
<structure name="BailCharge">
<collection get-method="getBailCharges"
set-method="setBailCharges"
item-type="com.datacapture.general.common.ChargeVO"/>
</structure>
</structure>
But fot the first set it's availble. ie for this.
<structure get-method="getDoc" set-method="setDoc" usage="optional">
<structure name="ActivityID">
<value name="ID"
get-method="getActivityID" set-method="setActivityID" usage="optional"/>
</structure>
<value name="ActivityDate"
get-method="getBailDate" set-method="setBailDate" usage="optional"/>
<value name="ActivityTime"
get-method="getBailTime" set-method="setBailTime" usage="optional"/>
<value name="BailSetAmount"
get-method="getBailSetAmount" set-method="setBailSetAmount"
usage="optional"/>
</structure>
thanks
Siva
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Mocky Habeeb
Sent: Wednesday, September 21, 2005 8:07 AM
To: [email protected]
Subject: RE: [jibx-users] Unmarshalling, Loosing the scope of the Data
I'm not sure what you mean by losing the data and having blank object
values. Do you mean that after you unmarshall and you get back ,for
instance, an instance of BailVO and that although BailVO is not null,
when you call BailVO.getDoc() that it returns null?
Mocky
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Narayanaswamy, Sivakumar
Sent: Monday, September 19, 2005 2:02 AM
To: [email protected]
Subject: [jibx-users] Unmarshalling, Loosing the scope of the Data
Hi,
I am new to JIBX and just started using it after reading the online help
I am referring the same class instance in two places in the same binding
file. While marshalling the XML looks perfect. But while Unmarshalling
I am loosing the data. the object values are blank.
Is their any way to retain or to keep the instance which has been
created. Here is my Binding file.
<binding>
<mapping name="NHBail" class="com.test.common.BailVO">
<structure get-method="getDoc" set-method="setDoc"
usage="optional">
<structure name="ActivityID">
<value name="ID"
get-method="getActivityID" set-method="setActivityID" usage="optional"/>
</structure>
<value name="ActivityDate"
get-method="getBailDate" set-method="setBailDate" usage="optional"/>
<value name="ActivityTime"
get-method="getBailTime" set-method="setBailTime" usage="optional"/>
<value name="BailSetAmount"
get-method="getBailSetAmount" set-method="setBailSetAmount"
usage="optional"/>
</structure>
<structure get-method="getQuest" set-method="setQuest"
usage="optional">
<structure name="PersonName">
<value name="PersonGivenName"
get-method="getFirstName" set-method="setFirstName" usage="optional"/>
<value name="PersonMiddleName"
get-method="getMiddleName" set-method="setMiddleName" usage="optional"/>
<value name="PersonSurName"
get-method="getSurName" set-method="setSurName" usage="optional"/>
<value name="PersonNameID"
get-method="getPersonNameID" set-method="setPersonNameID"
usage="optional"/>
</structure>
</structure>
<structure get-method="getDoc" set-method="setDoc"
usage="optional">
<structure name="BailCharge">
<collection get-method="getBailCharges"
set-method="setBailCharges"
item-type="com.datacapture.general.common.ChargeVO"/>
</structure>
</structure>
</mapping>
<mapping name="ChargeStatute" class="com.test.common.ChargeVO">
<structure name="StatuteCodeID">
<structure name="ID">
<value name="ID" get-method="getID"
set-method="setID" usage="optional"/>
</structure>
</structure>
<value name="StatuteText" get-method="getStatuteText"
set-method="setStatuteText" usage="optional"/>
<value name="StatuteDescriptionText"
get-method="getStatuteDescriptionText"
set-method="setStatuteDescriptionText" usage="optional"/>
</mapping>
</binding>
thanks in advance.
Siva
Sivakumar Narayanaswamy | Consultant, Public Services | BearingPoint |
99 High Street Boston, MA 02110 |
Phone: 617-378-3656 | Fax: 617-988-0675 | Cell Phone: 847-302-1283 |
[EMAIL PROTECTED]
************************************************************************
***************************
The information in this email is confidential and may be legally
privileged. Access to this email by anyone other than the intended
addressee is unauthorized. If you are not the intended recipient of
this message, any review, disclosure, copying, distribution, retention,
or any action taken or omitted to be taken in reliance on it is
prohibited and may be unlawful. If you are not the intended recipient,
please reply to or forward a copy of this message to the sender and
delete the message, any attachments, and any copies thereof from your
system.
************************************************************************
***************************
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your
very own Sony(tm)PSP. Click here to play:
http://sourceforge.net/geronimo.php
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your
very own Sony(tm)PSP. Click here to play:
http://sourceforge.net/geronimo.php
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users
************************************************************************
***************************
The information in this email is confidential and may be legally
privileged. Access to this email by anyone other than the intended
addressee is unauthorized. If you are not the intended recipient of
this message, any review, disclosure, copying, distribution, retention,
or any action taken or omitted to be taken in reliance on it is
prohibited and may be unlawful. If you are not the intended recipient,
please reply to or forward a copy of this message to the sender and
delete the message, any attachments, and any copies thereof from your
system.
************************************************************************
***************************
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your
very own Sony(tm)PSP. Click here to play:
http://sourceforge.net/geronimo.php
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users
***************************************************************************************************
The information in this email is confidential and may be legally privileged.
Access to this email by anyone other than the intended addressee is
unauthorized. If you are not the intended recipient of this message, any
review, disclosure, copying, distribution, retention, or any action taken or
omitted to be taken in reliance on it is prohibited and may be unlawful. If
you are not the intended recipient, please reply to or forward a copy of this
message to the sender and delete the message, any attachments, and any copies
thereof from your system.
***************************************************************************************************
HujzjzymvڲzŸ=kqzzozjozqz~z
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users