well the new mapping suggested below worked.
btw the earlier mapping was generated by jibx codegen tool when provided
with the schema (xsd) file.

Thanks
Sachin



Thomas Jones-Low wrote:
> 
> Sachin Mittal wrote:
>> Hi,
>> Here I am using primitive type int. I cannot do anything like you have
>> mentioned with int.
>> I can change that to java.lang.Integer but again this class does not have
>> any no argument constructor or factory method that returns new instance
>> of
>> Integer.
>> Infact I had tried replacing int with java.lang.Integer and this still
>> did
>> not work.
>> 
>> So question is how can we use primitive types in jibx mappings.
>> 
> 
>       JiBX does not handle primitives well, it assumes everything is a going 
> into a class.
> 
>       I'm guessing (based upon your mapping fragment) your XML is:
> 
> <calendar_campaign_identifier>12345</calendar_campaign_identifier>
> 
>       I would write the mapping for this as:
> <value style="element" get-method="getCalendarCampaignId" 
> set-method="setCalendarCampaignId" name="calendar_campaign_id">
> 
>       Get rid of the <structure ...> and <type ...> tags. The conversion from 
> string to integer is done in the get/setCalendarCampaignID() methods.
> 
> 


-----
http://www.assembla.com/wiki/show/sachin_mittal about me: 
-- 
View this message in context: 
http://www.nabble.com/Need-no-argument-constructor-or-factory-method-for-class-int-tp23557952p23561409.html
Sent from the jibx-users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to