-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate Schema
PostPosted: Fri Sep 19, 2003 8:05 pm 
I am working on a tool to generate Hibernate mappings and needed a schema (of the xsd variety) so I created one. So far it is working against my mapping files. Here it is if anyone is interested:

<?xml version="1.0" encoding="iso-8859-1"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="hibernate-mapping">
<xsd:annotation>
<xsd:documentation>An instance of this XML document may contain mappings for an arbitrary number of classes. The class mappings may contain associations to classes mapped in the same document or in another document. No class may be mapped more than once. Each document may also contains mappings for an arbitrary number of toplevel collections. Toplevel collection roles may be referenced by later class and collection mappings in the same document. (They must be declared before they are used.) The document root.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="meta" />
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="class" />
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="query" />
</xsd:sequence>
<xsd:attribute name="schema" type="xsd:string" use="optional" />
<xsd:attribute default="none" name="default-cascade">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="none" />
<xsd:enumeration value="save-update" />
<xsd:enumeration value="all" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="true" name="auto-import">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="class">
<xsd:annotation>
<xsd:documentation>Root of an entity class hierarchy. Entities have their own tables.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="meta" />
<xsd:element maxOccurs="1" minOccurs="0" ref="jcs-cache" />
<xsd:choice>
<xsd:element ref="id" />
<xsd:element ref="composite-id" />
</xsd:choice>
<xsd:element maxOccurs="1" minOccurs="0" ref="discriminator" />
<xsd:choice maxOccurs="1" minOccurs="0">
<xsd:element ref="version" />
<xsd:element ref="timestamp" />
</xsd:choice>
<xsd:choice maxOccurs="unbounded" minOccurs="0">
<xsd:element ref="property" />
<xsd:element ref="many-to-one" />
<xsd:element ref="one-to-one" />
<xsd:element ref="component" />
<xsd:element ref="dynabean" />
<xsd:element ref="map" />
<xsd:element ref="set" />
<xsd:element ref="list" />
<xsd:element ref="bag" />
<xsd:element ref="array" />
<xsd:element ref="primitive-array" />
</xsd:choice>
<xsd:choice>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="subclass" />
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="joined-subclass" />
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="table" type="xsd:string" use="optional" />
<xsd:attribute name="schema" type="xsd:string" use="optional" />
<xsd:attribute name="proxy" type="xsd:string" use="optional" />
<xsd:attribute name="discriminator-value" type="xsd:string" use="optional" />
<xsd:attribute default="true" name="mutable">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="implicit" name="polymorphism">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="implicit" />
<xsd:enumeration value="explicit" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="persister" type="xsd:string" use="optional" />
<xsd:attribute default="false" name="dynamic-update">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="false" name="dynamic-insert">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="id">
<xsd:annotation>
<xsd:documentation>Declares the id type, column and generation algorithm for an entity class. If a name attribut is given, the id is exposed to the application through the named property of the class. If not, the id is only exposed to the application through Session.getID()</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="meta" />
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="column" />
<xsd:element ref="generator" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="optional" />
<xsd:attribute name="column" type="xsd:string" use="optional" />
<xsd:attribute name="type" type="xsd:string" use="optional" />
<xsd:attribute name="length" type="xsd:string" use="optional" />
<xsd:attribute default="null" name="unsaved-value" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="composite-id">
<xsd:annotation>
<xsd:documentation>any|none|null|0|-1|... A composite key may be modelled by a java class with a property for each key column. The class must implement java.io.Serializable and reimplement equals() and hashCode().</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:choice maxOccurs="unbounded" minOccurs="1">
<xsd:element ref="key-property" />
<xsd:element ref="key-many-to-one" />
</xsd:choice>
<xsd:attribute name="class" type="xsd:string" use="optional" />
<xsd:attribute name="name" type="xsd:string" use="optional" />
<xsd:attribute default="none" name="unsaved-value">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="any" />
<xsd:enumeration value="none" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="discriminator">
<xsd:annotation>
<xsd:documentation>Polymorphic data requires a column holding a class discriminator value. This value is not directly exposed to the application.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" ref="column" />
</xsd:sequence>
<xsd:attribute name="column" type="xsd:string" use="optional" />
<xsd:attribute default="string" name="type" type="xsd:string" />
<xsd:attribute default="true" name="not-null">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="length" type="xsd:string" use="optional" />
<xsd:attribute default="false" name="force">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="version">
<xsd:annotation>
<xsd:documentation>Versioned data requires a column holding a version number. This is exposed to the application through a property of the Java class.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="column" type="xsd:string" use="optional" />
<xsd:attribute default="integer" name="type" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="timestamp">
<xsd:complexType>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="column" type="xsd:string" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="subclass">
<xsd:annotation>
<xsd:documentation>Subclass declarations are nested beneath the root class declaration to achieve polymorphic persistence.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="meta" />
<xsd:choice maxOccurs="unbounded" minOccurs="0">
<xsd:element ref="property" />
<xsd:element ref="many-to-one" />
<xsd:element ref="one-to-one" />
<xsd:element ref="component" />
<xsd:element ref="map" />
<xsd:element ref="set" />
<xsd:element ref="list" />
<xsd:element ref="bag" />
<xsd:element ref="array" />
<xsd:element ref="primitive-array" />
</xsd:choice>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="subclass" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="proxy" type="xsd:string" use="optional" />
<xsd:attribute name="discriminator-value" type="xsd:string" use="optional" />
<xsd:attribute default="false" name="dynamic-update">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="joined-subclass">
<xsd:annotation>
<xsd:documentation>Joined subclasses are used for the normalized table-per-subclass mapping strategy</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="meta" />
<xsd:element ref="key" />
<xsd:choice maxOccurs="unbounded" minOccurs="0">
<xsd:element ref="property" />
<xsd:element ref="many-to-one" />
<xsd:element ref="one-to-one" />
<xsd:element ref="component" />
<xsd:element ref="map" />
<xsd:element ref="set" />
<xsd:element ref="list" />
<xsd:element ref="bag" />
<xsd:element ref="array" />
<xsd:element ref="primitive-array" />
</xsd:choice>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="joined-subclass" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="proxy" type="xsd:string" use="optional" />
<xsd:attribute name="table" type="xsd:string" use="optional" />
<xsd:attribute name="schema" type="xsd:string" use="optional" />
<xsd:attribute default="false" name="dynamic-update">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="property">
<xsd:annotation>
<xsd:documentation>Property of an entity class or component, component-element, composite-id, etc. JavaBeans style properties are mapped to table columns.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="meta" />
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="column" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="type" type="xsd:string" use="optional" />
<xsd:attribute name="column" type="xsd:string" use="optional" />
<xsd:attribute name="length" type="xsd:string" use="optional" />
<xsd:attribute default="false" name="not-null">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="false" name="unique">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="true" name="update">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="true" name="insert">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="many-to-one">
<xsd:annotation>
<xsd:documentation>only supported for properties of a class (not component) Declares an association between two entities (Or from a component, component element, etc. to an entity).</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="meta" />
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="column" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="class" type="xsd:string" use="optional" />
<xsd:attribute name="column" type="xsd:string" use="optional" />
<xsd:attribute default="false" name="not-null">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="false" name="unique">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="cascade" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="none" />
<xsd:enumeration value="all" />
<xsd:enumeration value="save-update" />
<xsd:enumeration value="delete" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="auto" name="outer-join">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
<xsd:enumeration value="auto" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="true" name="update">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="true" name="insert">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="one-to-one">
<xsd:annotation>
<xsd:documentation>only supported for many-to-one of a class (not component) Declares a one-to-one association between two entities (Or from a component, component element, etc. to an entity).</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="meta" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="class" type="xsd:string" use="optional" />
<xsd:attribute name="cascade" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="none" />
<xsd:enumeration value="all" />
<xsd:enumeration value="save-update" />
<xsd:enumeration value="delete" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="auto" name="outer-join">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
<xsd:enumeration value="auto" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="false" name="constrained">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="key-property">
<xsd:annotation>
<xsd:documentation>A property embedded in a composite identifier or map index (always not-null).</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="column" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="type" type="xsd:string" use="optional" />
<xsd:attribute name="column" type="xsd:string" use="optional" />
<xsd:attribute name="length" type="xsd:string" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="key-many-to-one">
<xsd:annotation>
<xsd:documentation>A many-to-one association embedded in a composite identifier or map index (always not-null, never cascade).</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="column" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="class" type="xsd:string" use="optional" />
<xsd:attribute name="column" type="xsd:string" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="component">
<xsd:annotation>
<xsd:documentation>A component is a user-defined class, persisted along with its containing entity to the table of the entity class. JavaBeans style properties of the component are mapped to columns of the table of the containing entity. A null component reference is mapped to null values in all columns and vice versa. Components do not support shared reference semantics.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" ref="parent" />
<xsd:choice maxOccurs="unbounded" minOccurs="0">
<xsd:element ref="property" />
<xsd:element ref="many-to-one" />
<xsd:element ref="one-to-one" />
<xsd:element ref="component" />
<xsd:element ref="dynabean" />
<xsd:element ref="map" />
<xsd:element ref="set" />
<xsd:element ref="list" />
<xsd:element ref="bag" />
<xsd:element ref="array" />
<xsd:element ref="primitive-array" />
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="class" type="xsd:string" use="optional" />
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="dynabean">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded" minOccurs="0">
<xsd:element ref="property" />
<xsd:element ref="many-to-one" />
<xsd:element ref="one-to-one" />
<xsd:element ref="component" />
<xsd:element ref="dynabean" />
<xsd:element ref="map" />
<xsd:element ref="set" />
<xsd:element ref="list" />
<xsd:element ref="bag" />
<xsd:element ref="array" />
<xsd:element ref="primitive-array" />
</xsd:choice>
<xsd:attribute name="dynaclass" type="xsd:string" use="required" />
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="parent">
<xsd:annotation>
<xsd:documentation>The parent element maps a property of the component class as a pointer back to the owning entity.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="map">
<xsd:annotation>
<xsd:documentation>Collection declarations nested inside a class declaration indicate a foreign key relationship from the collection table to the enclosing class.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="meta" />
<xsd:element maxOccurs="1" minOccurs="0" ref="jcs-cache" />
<xsd:element ref="key" />
<xsd:choice>
<xsd:element ref="index" />
<xsd:element ref="composite-index" />
<xsd:element ref="index-many-to-many" />
</xsd:choice>
<xsd:choice>
<xsd:element ref="element" />
<xsd:element ref="one-to-many" />
<xsd:element ref="many-to-many" />
<xsd:element ref="composite-element" />
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="table" type="xsd:string" use="optional" />
<xsd:attribute name="schema" type="xsd:string" use="optional" />
<xsd:attribute default="false" name="lazy">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="false" name="inverse">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="sort" type="xsd:string" use="optional" />
<xsd:attribute name="cascade" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="none" />
<xsd:enumeration value="all" />
<xsd:enumeration value="save-update" />
<xsd:enumeration value="delete" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="order-by" type="xsd:string" use="optional" />
<xsd:attribute name="where" type="xsd:string" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="set">
<xsd:annotation>
<xsd:documentation>default: none</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="meta" />
<xsd:element maxOccurs="1" minOccurs="0" ref="jcs-cache" />
<xsd:element ref="key" />
<xsd:choice>
<xsd:element ref="element" />
<xsd:element ref="one-to-many" />
<xsd:element ref="many-to-many" />
<xsd:element ref="composite-element" />
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="table" type="xsd:string" use="optional" />
<xsd:attribute name="schema" type="xsd:string" use="optional" />
<xsd:attribute default="false" name="lazy">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="unsorted" name="sort" type="xsd:string" />
<xsd:attribute default="false" name="inverse">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="cascade" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="none" />
<xsd:enumeration value="all" />
<xsd:enumeration value="save-update" />
<xsd:enumeration value="delete" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="order-by" type="xsd:string" use="optional" />
<xsd:attribute name="where" type="xsd:string" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="bag">
<xsd:annotation>
<xsd:documentation>default: none</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="meta" />
<xsd:element maxOccurs="1" minOccurs="0" ref="jcs-cache" />
<xsd:element ref="key" />
<xsd:choice>
<xsd:element ref="element" />
<xsd:element ref="one-to-many" />
<xsd:element ref="many-to-many" />
<xsd:element ref="composite-element" />
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="table" type="xsd:string" use="optional" />
<xsd:attribute name="schema" type="xsd:string" use="optional" />
<xsd:attribute default="false" name="lazy">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="false" name="inverse">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="cascade" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="none" />
<xsd:enumeration value="all" />
<xsd:enumeration value="save-update" />
<xsd:enumeration value="delete" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="order-by" type="xsd:string" use="optional" />
<xsd:attribute name="where" type="xsd:string" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="list">
<xsd:annotation>
<xsd:documentation>default: none</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="meta" />
<xsd:element maxOccurs="1" minOccurs="0" ref="jcs-cache" />
<xsd:element ref="key" />
<xsd:element ref="index" />
<xsd:choice>
<xsd:element ref="element" />
<xsd:element ref="one-to-many" />
<xsd:element ref="many-to-many" />
<xsd:element ref="composite-element" />
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="table" type="xsd:string" use="optional" />
<xsd:attribute name="schema" type="xsd:string" use="optional" />
<xsd:attribute default="false" name="lazy">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="false" name="inverse">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="cascade" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="none" />
<xsd:enumeration value="all" />
<xsd:enumeration value="save-update" />
<xsd:enumeration value="delete" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="where" type="xsd:string" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="array">
<xsd:annotation>
<xsd:documentation>default: none</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="meta" />
<xsd:element maxOccurs="1" minOccurs="0" ref="jcs-cache" />
<xsd:element ref="key" />
<xsd:element ref="index" />
<xsd:choice>
<xsd:element ref="element" />
<xsd:element ref="one-to-many" />
<xsd:element ref="many-to-many" />
<xsd:element ref="composite-element" />
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="table" type="xsd:string" use="optional" />
<xsd:attribute name="schema" type="xsd:string" use="optional" />
<xsd:attribute name="element-class" type="xsd:string" use="optional" />
<xsd:attribute name="cascade" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="none" />
<xsd:enumeration value="all" />
<xsd:enumeration value="save-update" />
<xsd:enumeration value="delete" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="where" type="xsd:string" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="primitive-array">
<xsd:annotation>
<xsd:documentation>default: none</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="meta" />
<xsd:element maxOccurs="1" minOccurs="0" ref="jcs-cache" />
<xsd:element ref="key" />
<xsd:element ref="index" />
<xsd:element ref="element" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="table" type="xsd:string" use="optional" />
<xsd:attribute name="schema" type="xsd:string" use="optional" />
<xsd:attribute name="where" type="xsd:string" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="element">
<xsd:annotation>
<xsd:documentation>default: none Declares the element type of a collection of basic type</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="column" />
</xsd:sequence>
<xsd:attribute name="column" type="xsd:string" use="optional" />
<xsd:attribute name="type" type="xsd:string" use="required" />
<xsd:attribute name="length" type="xsd:string" use="optional" />
<xsd:attribute default="false" name="not-null">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="false" name="unique">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="one-to-many">
<xsd:annotation>
<xsd:documentation>One to many association. This tag declares the entity-class element type of a collection and specifies a one-to-many relational model</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:attribute name="class" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="many-to-many">
<xsd:annotation>
<xsd:documentation>No column declaration attributes required in this case. The primary key column of the associated class is already mapped elsewhere. Many to many association. This tag declares the entity-class element type of a collection and specifies a many-to-many relational model</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="meta" />
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="column" />
</xsd:sequence>
<xsd:attribute name="class" type="xsd:string" use="required" />
<xsd:attribute name="column" type="xsd:string" use="optional" />
<xsd:attribute default="false" name="not-null">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute default="auto" name="outer-join">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
<xsd:enumeration value="auto" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="composite-element">
<xsd:annotation>
<xsd:documentation>unique makes no sense here since it would make the association one-to-many A composite element allows a collection to hold instances of an arbitrary class, without the requirement of joining to an entity table. Composite elements have component semantics - no shared references and ad hoc null value semantics. Composite elements may not hold nested collections.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" ref="parent" />
<xsd:choice maxOccurs="unbounded" minOccurs="0">
<xsd:element ref="property" />
<xsd:element ref="many-to-one" />
<xsd:element ref="nested-composite-element" />
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="class" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="nested-composite-element">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="0" ref="parent" />
<xsd:choice maxOccurs="unbounded" minOccurs="0">
<xsd:element ref="property" />
<xsd:element ref="many-to-one" />
<xsd:element ref="nested-composite-element" />
</xsd:choice>
</xsd:sequence>
<xsd:attribute name="class" type="xsd:string" use="required" />
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="key">
<xsd:annotation>
<xsd:documentation>Declares the type, column name (and, in the case of toplevel collections, an id generation strategy) for the key of a collection table. These keys are never exposed to the application.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="column" />
</xsd:sequence>
<xsd:attribute name="column" type="xsd:string" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="index">
<xsd:annotation>
<xsd:documentation>Declares the type and column mapping for a collection index (array or list index, or key of a map).</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="column" />
</xsd:sequence>
<xsd:attribute name="column" type="xsd:string" use="optional" />
<xsd:attribute name="type" type="xsd:string" use="optional" />
<xsd:attribute name="length" type="xsd:string" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="index-many-to-many">
<xsd:annotation>
<xsd:documentation>Many to many association mapped to the key of a map. ie. a map keyed on entities.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="column" />
</xsd:sequence>
<xsd:attribute name="class" type="xsd:string" use="required" />
<xsd:attribute name="column" type="xsd:string" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="composite-index">
<xsd:annotation>
<xsd:documentation>Composite index of a map ie. a map keyed on components.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:choice maxOccurs="unbounded" minOccurs="1">
<xsd:element ref="key-property" />
<xsd:element ref="key-many-to-one" />
</xsd:choice>
<xsd:attribute name="class" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="generator">
<xsd:annotation>
<xsd:documentation>Generators generate unique identifiers. The class attribute specifies a Java class implementing an id generation algorithm.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" ref="param" />
</xsd:sequence>
<xsd:attribute name="class" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
<xsd:element name="param">
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="column">
<xsd:annotation>
<xsd:documentation>The column element is an alternative to column attributes and required for mapping associations to classes with composite ids.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:attribute name="name" type="xsd:string" use="required" />
<xsd:attribute name="length" type="xsd:string" use="optional" />
<xsd:attribute name="not-null" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="unique" use="optional">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="true" />
<xsd:enumeration value="false" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
<xsd:attribute name="unique-key" type="xsd:string" use="optional" />
<xsd:attribute name="sql-type" type="xsd:string" use="optional" />
<xsd:attribute name="index" type="xsd:string" use="optional" />
</xsd:complexType>
</xsd:element>
<xsd:element name="jcs-cache">
<xsd:annotation>
<xsd:documentation>The jcs-cache element enables caching of an entity class.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:attribute name="usage" use="required">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="read-only" />
<xsd:enumeration value="read-write" />
</xsd:restriction>
</xsd:simpleType>
</xsd:attribute>
</xsd:complexType>
</xsd:element>
<xsd:element name="query">
<xsd:annotation>
<xsd:documentation>The query element declares a named Hibernate query string</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
<xsd:element name="meta">
<xsd:annotation>
<xsd:documentation>The meta element is used to assign meta-level attributes to a class or property. Is currently used by codegenerator as a placeholder for values that is not directly related to OR mappings.</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:simpleContent>
<xsd:extension base="xsd:string">
<xsd:attribute name="attribute" type="xsd:string" use="required" />
</xsd:extension>
</xsd:simpleContent>
</xsd:complexType>
</xsd:element>
</xsd:schema>


Top
  
 
 Post subject:
PostPosted: Sun Sep 21, 2003 9:11 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
This _is_ interesting. It would be better to submit this to JIRA, however. It will quickly get lost here....

TIA


Top
 Profile  
 
 Post subject:
PostPosted: Sun Sep 21, 2003 11:22 pm 
I added the Schema and JAXB binding file to Jira:

http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-351&page=history


Top
  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.