I don't know if it worked in SDO 1 either, but a big change in this area 
is that the xsd types now map to commonj.sdo types as descirbed in the SDO 
2 spec. In SDO 1, they mapped to types in the EMF XMLTypePackage. 

In SDO 2 (Tuscany), xsd:dateTime maps to this type (defined in 
sdoModel.xsd):

<xsd:simpleType name="DateTime" sdoJava:instanceClass="java.lang.String">
  <xsd:restriction base="xsd:dateTime"/>
</xsd:simpleType>

It, along with all of the commonj types, is generated in class 
org.apache.tuscany.sdo.model.impl.ModelFactoryImpl. I don't know how the 
EMF validator will handle this type.

Frank.




Ron Gavlin <[EMAIL PROTECTED]> 
01/16/2007 01:05 PM
Please respond to
[email protected]


To
tuscany-user tuscany-user <[email protected]>
cc

Subject
Problem w/SDO xsd:dateTime value being validated using EMF 
Diagnostician.validate()






Greetings,

I have an xsd:dateTime child element in an XML Schema that I use to 
statically generate Tuscany SDO classes. Since Tuscany does not currently 
provide a schema validation API, I have been using EMF to accomplish this 
task using the following code:

...
Diagnostic diagnostic = 
   Diagnostician.INSTANCE.validate((EObject) 
myDataObjectwithDateTimeChildProperty);
if (diagnostic.getSeverity() == Diagnostic.ERROR)
{
    throw new Exception(diagnostic.getChildren().toString());
}

This technique works fine for most schema validation issues, like min/max 
facet length enforcement for child xsd:strings, etc. However, EMF is 
performing no validation against my Tuscany DateTime field (I can supply a 
bogus dateTime and no diagnostic error is generated). Is this an EMF 
problem or a Tuscany/EMF integration problem? I thought this used to work 
with the Eclipse EMF-based SDO 1.0 implementation but I may be wrong. Any 
suggestions would be greatly appreciated.

Thanks in advance,

- Ron

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to