The only way to prevent it is to change the field type from int to
Integer by enabling primitive object wrappers in the
castorbuilder.properties.
Castor's source generator was designed for Castor XML, so while it may
be used with Castor JDO, it might not always be perfect.
The reason it's created is that Castor XML needs to know if a field is
present. Objects are easy because you can check for null, but primitive
types have default values. There is no way to check without having the
extra boolean.
Thanks,
--Keith
> John Wang wrote:
>
> Everytime I use the source generator to generate a schema, it will
> create a method for a "integer' field. For example, a field is
> defined:
> xsd:element name="Quantity" type="xsd:integer" minOccurs="1"
> maxOccurs="1"/>
>
> It will generate two properties:
>
> private int _quantity;
>
> /**
> * keeps track of state for field: _quantity
> **/
> private boolean _has_quantity;
>
> Is there a way to disable generating the second boolean attribute?
> Because When I use the DDL/JDO Doclet, it always generate a XML field
> map and a database column for this boolean field.
>
> If it has to be generated, do I need to create a table column to hold
> this boolean attribute? That will be a waste of effort.
>
> Thanks ahead,
> John
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev