-----Original Message-----
From: Arijit Mukherjee [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 03, 2003 6:46 AM
To: [EMAIL PROTECTED]
Subject: [castor-dev] Compilation problem in castor generated codeHI
I am new to Castor (just been a day or two). I have a schema with which I am trying to build an object model. Following is the schema:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="Partitions">
<xs:annotation>
<xs:documentation>This is a sequence of partitions created by the query optimiser</xs:documentation></xs:annotation>
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="Partition">
<xs:complexType>
<xs:sequence>
<xs:element name="evaluatorURI" type="xs:anyURI"/>
<xs:element name="Operator" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:choice><xs:element name="SELECTOperator" type="SELECTOperatorType"/>
<xs:element name="REDUCEOperator" type="REDUCEOperatorType"/>
<xs:element name="PRINTOperator" type="PRINTOperatorType"/>
</xs:choice>
</xs:sequence>
<xs:attribute name="operatorID" type="xs:ID" use="required"/></xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="OperatorID" type="xs:ID"/>
<xs:complexType name="SELECTOperatorType">
<xs:sequence>
<xs:element ref="predicateExpr"/>
<xs:element name="inputOperator" type="operatorReferenceType"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="operatorReferenceType">
<xs:choice>
<xs:element name="EvaluatorURI" type="xs:anyURI" minOccurs="0"/>
<xs:element name="OperatorID" type="xs:ID"/>
</xs:choice>
</xs:complexType>
<xs:complexType name="REDUCEOperatorType">
<xs:sequence>
<xs:element name="inputOperator" type="operatorReferenceType"/>
<xs:element name="applyOperationType">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="APPLY_PROJECT"/>
<xs:enumeration value="APPLY_AGGREGATE"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="parameters">
<xs:complexType>
<xs:sequence>
<xs:element name="attributeName" type="xs:string" maxOccurs="unbounded"/></xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="aggregationOperators">
<xs:complexType>
<xs:sequence maxOccurs="unbounded">
<xs:element name="attributeName"/>
<xs:element name="aggregationType">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="SUM"/>
<xs:enumeration value="MIN"/>
<xs:enumeration value="AVG"/>
<xs:enumeration value="COUNT"/>
<xs:enumeration value="MAX"/>
<xs:enumeration value="STDDEV"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PRINTOperatorType">
<xs:sequence>
<xs:element name="inputOperator" type="operatorReferenceType"/>
</xs:sequence>
</xs:complexType>
<xs:element name="predicateExpr" type="predicateExprType">
<xs:annotation>
<xs:documentation>Comment describing your root element</xs:documentation>
</xs:annotation>
</xs:element>
<xs:complexType name="predicateType">
<xs:sequence>
<xs:element name="leftOperand" type="xs:string"/>
<xs:element name="comparativeOperator">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="EQ"/>
<xs:enumeration value="NEQ"/>
<xs:enumeration value="LEQ"/>
<xs:enumeration value="GEQ"/>
<xs:enumeration value="LE"/>
<xs:enumeration value="GT"/>
<xs:enumeration value="LIKE"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="rightOperand" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:element name="logicalOperator">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="AND"/>
<xs:enumeration value="OR"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:complexType name="predicateExprType">
<xs:choice>
<xs:element name="predicate" type="predicateType"/>
<xs:sequence>
<xs:element name="predicateExpr1" type="predicateExprType"/>
<xs:element ref="logicalOperator"/>
<xs:element name="predicateExpr2" type="predicateExprType"/>
</xs:sequence>
<xs:sequence>
<xs:element name="leftParanthesis" type="xs:string"/>
<xs:element name="predicateExpr3" type="predicateExprType"/>
<xs:element name="rightParanthesis" type="xs:string"/>
</xs:sequence>
</xs:choice>
</xs:complexType>
</xs:schema>
When I generate the source code from this and try to compile them, I get errors saying "Package does not exist" for all the enumerated types - which get generated in my <package directory>/types directory as <package name>.types package.
Probably it's not a classpath problem - I have checked that.
Can anybody help please?
Arijit
Title: Compilation problem in castor generated code
Arijit,
Why don't you try compiling again. I just
used castor-0.9.4.jar to generate your
schema -- the generated source compiled fine.
I got similar errors when I compiled ONLY the source in
the main package
and DIDN'T compile the source in
main.types.
--Erik
- [castor-dev] Compilation problem in castor generated cod... Arijit Mukherjee
- Erik.Ostermueller
