Christopher,
Try to use object wrappers instead of primitive when you generate your
classes.
In the castorbuiler.properties file set
"org.exolab.castor.builder.primitivetowrapper" to true.
org.exolab.castor.builder.primitivetowrapper=true
JW.
--- "MATHRUSSE, CHRISTOPHER (SBCSI)" <[EMAIL PROTECTED]> wrote:
> I have defined my element as follows:
>
> <xs:element name="agrmtMoCt" default="0">
> <xs:simpleType>
> <xs:restriction base="xs:integer">
> <xs:minInclusive value="0"/>
> <xs:maxInclusive value="99"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
>
>
> As you can see I have specified a default value of '0'.
>
> The generated class has defined as follows:
>
> /**
> * Defines the package's Term length in months.
> */
> private int _agrmtMoCt = 0;
>
> /**
> * keeps track of state for field: _agrmtMoCt
> */
> private boolean _has_agrmtMoCt;
>
> The problem I am faced with is in the constructor of the generated
> class
> the setAgrmtMoCt(0) is not being called. While the default value is
> assigned at declaration, the _has_agrmtMoCt is not being initialized
> so
> the result is an initial value of false. Unless I explicitly call in
> my
> code setAgrmtMoCt(0), the validate method will throw an exception
> complaining about a missing value. The behavior in the generated code
> is
> correct for xs:string and xs:decimal data types, but for some reason
> not
> for xs:integer.
>
> -------------------------------------------------
> If you wish to unsubscribe from this list, please
> send an empty message to the following address:
>
> [EMAIL PROTECTED]
> -------------------------------------------------
>
>
____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------