Thanks for clarification ; )
Adriano Crestani
On 5/31/07, Pete Robbins <[EMAIL PROTECTED]> wrote:
Adriano, this isn't so much a bug as unsupported function.
DataFactory::generateInterface() is not part of the spec (I believe) and
was
an old experiment in supporting static SDOs. As far as I am aware the code
has never been tested. I'm pretty sure I'd removed it before but it looks
like it's still in there!
Cheers,
On 31/05/07, Adriano Crestani <[EMAIL PROTECTED]> wrote:
>
> I used the DataFactory::generateInterface() and I got the following
code:
>
> ...
> DataObjectList& Config::getRelationship //missing parameters definition
> {
> return the_object->getList("Relationship");
> }
> ...
>
> It is not generating the parameters definition of any function that
> returns
> a DataObjectList&. Bellow is the code I use to generate the code above:
>
>
> commonj::sdo::DataFactoryPtr dataFactory =
> commonj::sdo::DataFactory::getDataFactory();
> commonj::sdo::XSDHelperPtr xsdh =
> commonj::sdo::HelperProvider::getXSDHelper(dataFactory);
> xsdh->defineFile("config.xsd");
> dataFactory->generateInterface("DataFactoryImpl", "DataFactoryImpl");
>
> And here is the config.xsd:
>
> <xsd:schema
> xmlns:config="apache.das.rdb"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> targetNamespace="apache.das.rdb.config"
> elementFormDefault="qualified">
>
> <xsd:element name="Config" type="Config"/>
>
> <xsd:complexType name="Config">
> <xsd:all>
> <xsd:element maxOccurs="unbounded" minOccurs="0" name="Table"
> type="Table"/>
> <xsd:element maxOccurs="unbounded" minOccurs="0"
> name="Relationship"
> type="Relationship"/>
> </xsd:all>
> <xsd:attribute name="uri" type="xsd:string"/>
> </xsd:complexType>
>
> <xsd:complexType name="Relationship">
> <xsd:all>
> <xsd:element maxOccurs="unbounded" minOccurs="1" name="KeyPair"
> type="KeyPair"/>
> </xsd:all>
> <xsd:attribute name="name" type="xsd:string"/>
> <xsd:attribute name="primaryKeyTable" type="xsd:string"
> use="required"/>
> <xsd:attribute name="foreignKeyTable" type="xsd:string"
> use="required"/>
> <xsd:attribute name="many" type="xsd:boolean" default="true"/>
> </xsd:complexType>
>
> <xsd:complexType name="Table">
> <xsd:all>
> <xsd:element maxOccurs="unbounded" minOccurs="0" name="Column"
> type="Column"/>
> </xsd:all>
> <xsd:attribute name="tableName" type="xsd:string" use="required"/>
> <xsd:attribute name="typeName" type="xsd:string"/>
> </xsd:complexType>
>
> <xsd:complexType name="KeyPair">
> <xsd:attribute name="primaryKeyColumn" type="xsd:string"
> use="required"/>
> <xsd:attribute name="foreignKeyColumn" type="xsd:string"
> use="required"/>
> </xsd:complexType>
>
> <xsd:complexType name="Column">
> <xsd:attribute name="columnName" type="xsd:string" use="required"/>
> <xsd:attribute name="sqlType" type="xsd:string" use="required"/>
> <xsd:attribute name="propertyName" type="xsd:string"/>
> <xsd:attribute name="primaryKey" type="xsd:boolean"
default="false"/>
> </xsd:complexType>
>
> </xsd:schema>
>
> Am I committing some mistake or it's really a bug?
>
> Adriano Crestani
>
--
Pete