[Objectbridge-developers] [Fwd: [objectbridge - Open Discussion] New repository.xml/dtd proposal.]
Brought to you by:
thma
From: Thomas M. <tho...@ho...> - 2001-08-28 17:14:12
|
Hi all, here is an important proposal that Ivan posted to the discussion forum. --thomas -------- Original Message -------- Subject: [objectbridge - Open Discussion] New repository.xml/dtd proposal. Date: Tue, 28 Aug 2001 07:34:38 -0700 From: no...@so... To: no...@so... Read and respond to this message at: http://sourceforge.net/forum/message.php?msg_id=221783 By: core Hello, Here is a proposal for new repository.xml and DTD based on the discussion, which took place in the mailing list. Unfortunately, there are some problems with my email provider, so I may be not aware of all the recent posts. The changes are as follows: 1) Decoupling the repository to the following top-level elements: jdbc-connection (formerly ConnectionDescriptor), table (formerly part of the ClassDescriptor), class (formerly part of the ClassDescriptor) and class-extension (formerly ClassDescriptor/ExtentDescriptor). 2) Put all the data in attributes, instead of as text. This is useful because the DTD can describe the attributes better than the text (e.g. enumeration of values) and it's easer to write SAX parser, because you can do most of the work in the start event, rather than the end. 3) Changed the naming convention to something, which more closely resambles the one used by W3C. One of the remaining issues is the element, formerly known as (prince? ;)) `deciptor_ids'. It contains a space separated list of foreign key references. I don't know if this should go to the new `table' or `class' elements. Anyway, here is the DTD: <?xml version="1.0" encoding="UTF-8" ?> <!ELEMENT mapping-repository ( jdbc-connection+, table+, class+, class-extension* ) > <!ELEMENT jdbc-connection EMPTY > <!ATTLIST jdbc-connection id ID #REQUIRED name CDATA #REQUIRED driver CDATA #REQUIRED protocol CDATA #REQUIRED subprotocol CDATA #REQUIRED dbalias CDATA #REQUIRED username CDATA #IMPLIED password CDATA #IMPLIED > <!ELEMENT table ( column+ ) > <!ATTLIST table id ID #REQUIRED name CDATA #REQUIRED jdbc-ref IDREF #REQUIRED > <!ELEMENT column EMPTY > <!ATTLIST column name CDATA #REQUIRED type ( INTEGER | DOUBLE | FLOAT | VARCHAR ) #REQUIRED primary-key ( yes | no ) "no" nullable ( yes | no ) "yes" indexed ( yes | no ) "no" size CDATA #IMPLIED > <!ELEMENT class ( extent*, field*, reference*, collection* ) > <!ATTLIST class name ID #REQUIRED table-ref IDREF #REQUIRED conversion-strategy CDATA #IMPLIED proxy CDATA #IMPLIED > <!ELEMENT extent EMPTY > <!ATTLIST extent class CDATA #REQUIRED > <!ELEMENT field EMPTY > <!ATTLIST field name CDATA #REQUIRED column CDATA #REQUIRED > <!ELEMENT reference ( ref-id ) > <!ATTLIST reference name CDATA #REQUIRED class NMTOKEN #REQUIRED auto-retrieve ( yes | no ) "no" auto-update ( yes | no ) "no" auto-delete ( yes | no ) "no" > <!ELEMENT ref-id EMPTY > <!ATTLIST ref-id id CDATA #REQUIRED > <!ELEMENT collection ( ref-id ) > <!ATTLIST collection name CDATA #REQUIRED item-class CDATA #REQUIRED collection-class CDATA #IMPLIED auto-retrieve ( yes | no ) "no" auto-update ( yes | no ) "no" auto-delete ( yes | no ) "no" > <!ELEMENT class-extension ( extent+ ) > <!ATTLIST class-extension name CDATA #REQUIRED > And here is the repository,xml (which still needs a little work): <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapping-repository SYSTEM "new-rep-gen.dtd"> <mapping-repository> <jdbc-connection dbalias="..\setup\demo.prp" subprotocol="idb" protocol="jdbc" driver="com.lutris.instantdb.jdbc.idbDriver" name="InstantDB" id="default"/> <jdbc-connection dbalias="dbwte001" subprotocol="db2" protocol="jdbc" driver="COM.ibm.db2.jdbc.app.DB2Driver" name="db2" id="db2" username="db2admin" password="db2"/> <jdbc-connection dbalias="@(description=(address=(host=127.0.0.1)(protocol=tcp)(port=1521))(conne ct_data=(sid=orcl)))" subprotocol="oracle:oci8" protocol="jdbc" driver="oracle.jdbc.driver.OracleDriver" name="oracle" id="oracle" username="scott" password="tiger"/> <table id="Artikel" jdbc-ref="default" name="Artikel"> <column type="INTEGER" name="Artikel_Nr" primary-key="yes"/> <column type="VARCHAR" name="Artikelname"/> <column type="INTEGER" name="Lieferanten_Nr"/> <column type="INTEGER" name="Kategorie_Nr"/> <column type="VARCHAR" name="Liefereinheit"/> <column type="FLOAT" name="Einzelpreis"/> <column type="INTEGER" name="Lagerbestand"/> <column type="INTEGER" name="BestellteEinheiten"/> <column type="INTEGER" name="MindestBestand"/> <column type="INTEGER" name="Auslaufartikel"/> </table> <table id="Kategorien" jdbc-ref="default" name="Kategorien"> <column type="INTEGER" name="Kategorie_Nr" primary-key="yes"/> <column type="VARCHAR" name="KategorieName"/> <column type="VARCHAR" name="Beschreibung"/> </table> <table id="BOOKS" jdbc-ref="default" name="BOOKS"> <column type="INTEGER" name="Artikel_Nr" primary-key="yes"/> <column type="VARCHAR" name="Artikelname"/> <column type="INTEGER" name="Lieferanten_Nr"/> <column type="INTEGER" name="Kategorie_Nr"/> <column type="VARCHAR" name="Liefereinheit"/> <column type="FLOAT" name="Einzelpreis"/> <column type="INTEGER" name="Lagerbestand"/> <column type="INTEGER" name="BestellteEinheiten"/> <column type="INTEGER" name="MindestBestand"/> <column type="INTEGER" name="Auslaufartikel"/> <column type="VARCHAR" name="ISBN"/> <column type="VARCHAR" name="AUTHOR"/> </table> <table id="CDS" jdbc-ref="default" name="CDS"> <column type="INTEGER" name="Artikel_Nr" primary-key="yes"/> <column type="VARCHAR" name="Artikelname"/> <column type="INTEGER" name="Lieferanten_Nr"/> <column type="INTEGER" name="Kategorie_Nr"/> <column type="VARCHAR" name="Liefereinheit"/> <column type="FLOAT" name="Einzelpreis"/> <column type="INTEGER" name="Lagerbestand"/> <column type="INTEGER" name="BestellteEinheiten"/> <column type="INTEGER" name="MindestBestand"/> <column type="INTEGER" name="Auslaufartikel"/> <column type="VARCHAR" name="LABEL"/> <column type="VARCHAR" name="MUSICIANS"/> </table> <table id="ORDER_POSITION" jdbc-ref="default" name="ORDER_POSITION"> <column type="INTEGER" name="ID" primary-key="yes"/> <column type="INTEGER" name="ORDER_ID"/> <column type="INTEGER" name="ARTICLE_ID"/> </table> <table id="TREE" jdbc-ref="default" name="TREE"> <column type="INTEGER" name="ID" primary-key="yes"/> <column type="VARCHAR" name="DATA"/> <column type="INTEGER" name="PARENT_ID"/> </table> <table id="TREEGROUP" jdbc-ref="default" name="TREEGROUP"> <column type="INTEGER" name="ID" primary-key="yes"/> <column type="VARCHAR" name="DATA"/> <column type="INTEGER" name="PARENT_ID"/> <column type="INTEGER" name="GROUP_ID"/> </table> <table id="PRODUCT" jdbc-ref="default" name="PRODUCT"> <column type="INTEGER" name="ID" primary-key="yes"/> <column type="VARCHAR" name="NAME"/> <column type="DOUBLE" name="PRICE"/> <column type="INTEGER" name="STOCK"/> </table> <table id="OJB_NRM" jdbc-ref="default" name="OJB_NRM"> <column type="VARCHAR" name="NAME" primary-key="yes"/> <column type="VARCHAR" name="OID"/> </table> <table id="OJB_DLIST" jdbc-ref="default" name="OJB_DLIST"> <column type="INTEGER" name="ID" primary-key="yes"/> <column type="INTEGER" name="SIZE_"/> </table> <table id="OJB_DLIST_ENTRIES" jdbc-ref="default" name="OJB_DLIST_ENTRIES"> <column type="INTEGER" name="ID" primary-key="yes"/> <column type="INTEGER" name="DLIST_ID"/> <column type="INTEGER" name="POSITION"/> <column type="VARCHAR" name="OID"/> </table> <table id="OJB_SEQ" jdbc-ref="default" name="OJB_SEQ"> <column type="VARCHAR" name="CLASSNAME" primary-key="yes"/> <column type="VARCHAR" name="FIELDNAME" primary-key="yes"/> <column type="INTEGER" name="LAST_NUM"/> </table> <table id="OJB_DSET" jdbc-ref="default" name="OJB_DSET"> <column type="INTEGER" name="ID" primary-key="yes"/> <column type="INTEGER" name="SIZE_"/> </table> <table id="OJB_DSET_ENTRIES" jdbc-ref="default" name="OJB_DSET_ENTRIES"> <column type="INTEGER" name="ID" primary-key="yes"/> <column type="INTEGER" name="DLIST_ID"/> <column type="INTEGER" name="POSITION"/> <column type="VARCHAR" name="OID"/> </table> <table id="OJB_DMAP" jdbc-ref="default" name="OJB_DMAP"> <column type="INTEGER" name="ID" primary-key="yes"/> <column type="INTEGER" name="SIZE_"/> </table> <table id="OJB_DMAP_ENTRIES" jdbc-ref="default" name="OJB_DMAP_ENTRIES"> <column type="INTEGER" name="ID" primary-key="yes"/> <column type="INTEGER" name="DMAP_ID"/> <column type="VARCHAR" name="KEY_OID"/> <column type="VARCHAR" name="VALUE_OID"/> </table> <class table-ref="Artikel" name="test.ojb.broker.Article" conversion-strategy="test.ojb.broker.ArticleConversionStrategy" proxy="test.ojb.broker.ArticleProxy"> <extent class="test.ojb.broker.BookArticle"/> <extent class="test.ojb.broker.CdArticle"/> <field column="Artikel_Nr" name="articleId"/> <field column="Artikelname" name="articleName"/> <field column="Lieferanten_Nr" name="supplierId"/> <field column="Kategorie_Nr" name="productGroupId"/> <field column="Liefereinheit" name="unit"/> <field column="Einzelpreis" name="price"/> <field column="Lagerbestand" name="stock"/> <field column="BestellteEinheiten" name="orderedUnits"/> <field column="MindestBestand" name="minimumStock"/> <field column="Auslaufartikel" name="isSelloutArticle"/> <reference class="test.ojb.broker.ProductGroup" name="productGroup" auto-retrieve="yes"> <ref-id id="4"/> </reference> </class> <class table-ref="Kategorien" name="test.ojb.broker.ProductGroup" proxy="test.ojb.broker.ProductGroupProxy"> <field column="Kategorie_Nr" name="groupId"/> <field column="KategorieName" name="groupName"/> <field column="Beschreibung" name="description"/> <collection item-class="test.ojb.broker.Article" name="allArticlesInGroup" auto-retrieve="yes"> <ref-id id="4"/> </collection> </class> <class table-ref="Kategorien" name="test.ojb.broker.ProductGroupWithTypedCollection"> <field column="Kategorie_Nr" name="groupId"/> <field column="KategorieName" name="groupName"/> <field column="Beschreibung" name="description"/> <collection item-class="test.ojb.broker.Article" name="allArticlesInGroup" collection-class="test.ojb.broker.ArticleCollection" auto-retrieve="yes" auto-update="yes" auto-delete="yes"> <ref-id id="4"/> </collection> </class> <class table-ref="Kategorien" name="test.ojb.broker.ProductGroupWithArray"> <field column="Kategorie_Nr" name="groupId"/> <field column="KategorieName" name="groupName"/> <field column="Beschreibung" name="description"/> <collection item-class="test.ojb.broker.Article" name="allArticlesInGroup" auto-retrieve="yes" auto-update="yes" auto-delete="yes"> <ref-id id="4"/> </collection> </class> <class table-ref="Artikel" name="test.ojb.odmg.Article"> <field column="Artikel_Nr" name="articleId"/> <field column="Artikelname" name="articleName"/> <field column="Lieferanten_Nr" name="supplierId"/> <field column="Kategorie_Nr" name="productGroupId"/> <field column="Liefereinheit" name="unit"/> <field column="Einzelpreis" name="price"/> <field column="Lagerbestand" name="stock"/> <field column="BestellteEinheiten" name="orderedUnits"/> <field column="MindestBestand" name="minimumStock"/> <field column="Auslaufartikel" name="isSelloutArticle"/> <reference class="test.ojb.odmg.ProductGroup" name="productGroup" auto-retrieve="yes"> <ref-id id="4"/> </reference> </class> <class table-ref="Kategorien" name="test.ojb.odmg.ProductGroup"> <field column="Kategorie_Nr" name="groupId"/> <field column="KategorieName" name="groupName"/> <field column="Beschreibung" name="description"/> <collection item-class="test.ojb.odmg.Article" name="allArticlesInGroup" auto-retrieve="yes"> <ref-id id="4"/> </collection> </class> <class table-ref="BOOKS" name="test.ojb.broker.BookArticle"> <field column="Artikel_Nr" name="articleId"/> <field column="Artikelname" name="articleName"/> <field column="Lieferanten_Nr" name="supplierId"/> <field column="Kategorie_Nr" name="productGroupId"/> <field column="Liefereinheit" name="unit"/> <field column="Einzelpreis" name="price"/> <field column="Lagerbestand" name="stock"/> <field column="BestellteEinheiten" name="orderedUnits"/> <field column="MindestBestand" name="minimumStock"/> <field column="Auslaufartikel" name="isSelloutArticle"/> <field column="ISBN" name="isbn"/> <field column="AUTHOR" name="author"/> <reference class="test.ojb.broker.ProductGroup" name="productGroup" auto-retrieve="yes"> <ref-id id="4"/> </reference> </class> <class table-ref="CDS" name="test.ojb.broker.CdArticle"> <field column="Artikel_Nr" name="articleId"/> <field column="Artikelname" name="articleName"/> <field column="Lieferanten_Nr" name="supplierId"/> <field column="Kategorie_Nr" name="productGroupId"/> <field column="Liefereinheit" name="unit"/> <field column="Einzelpreis" name="price"/> <field column="Lagerbestand" name="stock"/> <field column="BestellteEinheiten" name="orderedUnits"/> <field column="MindestBestand" name="minimumStock"/> <field column="Auslaufartikel" name="isSelloutArticle"/> <field column="LABEL" name="labelname"/> <field column="MUSICIANS" name="musicians"/> <reference class="test.ojb.broker.ProductGroup" name="productGroup" auto-retrieve="yes"> <ref-id id="4"/> </reference> </class> <class table-ref="ORDER_POSITION" name="test.ojb.broker.OrderPosition"> <field column="ID" name="id"/> <field column="ORDER_ID" name="order_id"/> <field column="ARTICLE_ID" name="article_id"/> <reference class="test.ojb.broker.Article" name="article" auto-retrieve="yes"> <ref-id id="3"/> </reference> </class> <class-extension name="test.ojb.broker.InterfaceArticle"> <extent class="test.ojb.broker.Article"/> <extent class="test.ojb.broker.BookArticle"/> <extent class="test.ojb.broker.CdArticle"/> </class-extension> <class table-ref="TREE" name="test.ojb.broker.Tree"> <field column="ID" name="id"/> <field column="DATA" name="data"/> <field column="PARENT_ID" name="parentId"/> <collection item-class="test.ojb.broker.Tree" name="childs" auto-retrieve="yes" auto-update="yes" auto-delete="yes"> <ref-id id="3"/> </collection> </class> <class table-ref="TREEGROUP" name="test.ojb.broker.TreeGroup"> <field column="ID" name="id"/> <field column="DATA" name="data"/> <field column="PARENT_ID" name="parentId"/> <field column="GROUP_ID" name="groupId"/> <reference class="test.ojb.broker.TreeGroup" name="myParent" auto-retrieve="yes"> <ref-id id="3"/> </reference> <reference class="test.ojb.broker.TreeGroup" name="myGroup" auto-retrieve="yes"> <ref-id id="4"/> </reference> <collection item-class="test.ojb.broker.TreeGroup" name="children" auto-retrieve="yes" auto-update="yes" auto-delete="yes"> <ref-id id="3"/> </collection> <collection item-class="test.ojb.broker.TreeGroup" name="groupMembers" auto-retrieve="yes" auto-update="yes" auto-delete="yes"> <ref-id id="4"/> </collection> </class> <class table-ref="PRODUCT" name="test.ojb.tutorial1.Product"> <field column="ID" name="_id"/> <field column="NAME" name="name"/> <field column="PRICE" name="price"/> <field column="STOCK" name="stock"/> </class> <class table-ref="PRODUCT" name="test.ojb.tutorial2.Product"> <field column="ID" name="_id"/> <field column="NAME" name="name"/> <field column="PRICE" name="price"/> <field column="STOCK" name="stock"/> </class> <class table-ref="OJB_NRM" name="ojb.odmg.NamedRootsEntry"> <field column="NAME" name="name"/> <field column="OID" name="oid"/> </class> <class table-ref="OJB_DLIST" name="ojb.odmg.collections.DListImpl"> <field column="ID" name="id"/> <field column="SIZE_" name="size"/> <collection item-class="ojb.odmg.collections.DListEntry" name="elements" auto-retrieve="yes"> <ref-id id="2"/> </collection> </class> <class table-ref="OJB_DLIST_ENTRIES" name="ojb.odmg.collections.DListEntry"> <field column="ID" name="id"/> <field column="DLIST_ID" name="dlistId"/> <field column="POSITION" name="position"/> <field column="OID" name="serializedOID"/> </class> <class table-ref="OJB_SEQ" name="ojb.broker.SequenceEntry"> <field column="CLASSNAME" name="classname"/> <field column="FIELDNAME" name="fieldname"/> <field column="LAST_NUM" name="current"/> </class> <class table-ref="OJB_DLIST" name="ojb.odmg.collections.DBagImpl"> <field column="ID" name="id"/> <field column="SIZE_" name="size"/> <collection item-class="ojb.odmg.collections.DListEntry" name="elements" auto-retrieve="yes"> <ref-id id="2"/> </collection> </class> <class table-ref="OJB_DSET" name="ojb.odmg.collections.DSetImpl"> <field column="ID" name="id"/> <field column="SIZE_" name="size"/> <collection item-class="ojb.odmg.collections.DSetEntry" name="elements" auto-retrieve="yes"> <ref-id id="2"/> </collection> </class> <class table-ref="OJB_DSET_ENTRIES" name="ojb.odmg.collections.DSetEntry"> <field column="ID" name="id"/> <field column="DLIST_ID" name="dlistId"/> <field column="POSITION" name="position"/> <field column="OID" name="serializedOID"/> </class> <class table-ref="OJB_DMAP" name="ojb.odmg.collections.DMapImpl"> <field column="ID" name="id"/> <field column="SIZE_" name="size"/> <collection item-class="ojb.odmg.collections.DMapEntry" name="entries" auto-retrieve="yes"> <ref-id id="2"/> </collection> </class> <class table-ref="OJB_DMAP_ENTRIES" name="ojb.odmg.collections.DMapEntry"> <field column="ID" name="id"/> <field column="DMAP_ID" name="dMapId"/> <field column="KEY_OID" name="keySerializedOID"/> <field column="VALUE_OID" name="valueSerializedOID"/> </class> </mapping-repository> (Hmm, I hope that this can be read) Comments are welcome! Cheers, Ivan Toshkov ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge and visit: http://sourceforge.net/forum/monitor.php?forum_id=43066 |