Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<?xml version="1.0" encoding="UTF-8"?>

<!-- Hibernate file-based configuration document.

An instance of this document contains property settings and references
to mapping files for a number of SessionFactory instances to be listed
in JNDI.

-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns="http://www.hibernate.org/xsd/hibernate-configuration"
           targetNamespace="http://www.hibernate.org/xsd/hibernate-configuration"
           elementFormDefault="qualified"
           version="4.0">

  <xs:element name="hibernate-configuration">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="session-factory">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="property" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType mixed="true">
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="name" use="required" type="xs:string"/> <!-- reference to a mapping file -->
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element name="mapping" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:attribute name="class" type="xs:string"/>
                  <xs:attribute name="file" type="xs:string"/>
                  <xs:attribute name="jar" type="xs:string"/>
                  <xs:attribute name="package" type="xs:string"/>
                  <xs:attribute name="resource" type="xs:string"/>
                </xs:complexType>
              </xs:element>
              <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element name="class-cache">
                  <xs:complexType>
                    <xs:attribute name="class" use="required" type="xs:string"/>
                    <xs:attribute name="include" default="all">
                      <xs:simpleType>
                        <xs:restriction base="xs:token">
                          <xs:enumeration value="all"/>
                          <xs:enumeration value="non-lazy"/>
                        </xs:restriction>
                      </xs:simpleType>
                    </xs:attribute>
                    <xs:attribute name="region" type="xs:string"/>
                    <xs:attribute name="usage" use="required" type="usage-attribute"/>
                  </xs:complexType>
                </xs:element>
                <xs:element name="collection-cache">
                  <xs:complexType>
                    <xs:attribute name="collection" use="required" type="xs:string"/>
                    <xs:attribute name="region" type="xs:string"/>
                    <xs:attribute name="usage" use="required" type="usage-attribute"/>
                  </xs:complexType>
                </xs:element>
              </xs:choice>
              <xs:element name="event" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="listener" minOccurs="0" maxOccurs="unbounded" type="listener-element"/>
                  </xs:sequence>
                  <xs:attribute name="type" use="required" type="type-attribute"/>
                </xs:complexType>
              </xs:element>
              <xs:element name="listener" minOccurs="0" maxOccurs="unbounded" type="listener-element"/>
            </xs:sequence>
            <xs:attribute name="name" type="xs:string"/> <!-- the JNDI name -->
          </xs:complexType>
        </xs:element>
        <xs:element name="security" minOccurs="0">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="grant" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:attribute name="actions" use="required" type="xs:string"/>
                  <xs:attribute name="entity-name" use="required" type="xs:string"/>
                  <xs:attribute name="role" use="required" type="xs:string"/>
                </xs:complexType>
              </xs:element>
            </xs:sequence>
            <xs:attribute name="context" use="required" type="xs:string"/> <!--the JACC contextID-->
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:complexType name="listener-element">
    <xs:attribute name="class" use="required" type="xs:string"/>
    <xs:attribute name="type" type="type-attribute"/>
  </xs:complexType>

  <xs:simpleType name="type-attribute">
    <xs:restriction base="xs:token">
      <xs:enumeration value="auto-flush"/>
      <xs:enumeration value="create"/>
      <xs:enumeration value="create-onflush"/>
      <xs:enumeration value="delete"/>
      <xs:enumeration value="dirty-check"/>
      <xs:enumeration value="evict"/>
      <xs:enumeration value="flush"/>
      <xs:enumeration value="flush-entity"/>
      <xs:enumeration value="load"/>
      <xs:enumeration value="load-collection"/>
      <xs:enumeration value="lock"/>
      <xs:enumeration value="merge"/>
      <xs:enumeration value="post-collection-recreate"/>
      <xs:enumeration value="post-collection-remove"/>
      <xs:enumeration value="post-collection-update"/>
      <xs:enumeration value="post-commit-delete"/>
      <xs:enumeration value="post-commit-insert"/>
      <xs:enumeration value="post-commit-update"/>
      <xs:enumeration value="post-delete"/>
      <xs:enumeration value="post-insert"/>
      <xs:enumeration value="post-load"/>
      <xs:enumeration value="post-update"/>
      <xs:enumeration value="pre-collection-recreate"/>
      <xs:enumeration value="pre-collection-remove"/>
      <xs:enumeration value="pre-collection-update"/>
      <xs:enumeration value="pre-delete"/>
      <xs:enumeration value="pre-insert"/>
      <xs:enumeration value="pre-load"/>
      <xs:enumeration value="pre-update"/>
      <xs:enumeration value="refresh"/>
      <xs:enumeration value="replicate"/>
      <xs:enumeration value="save"/>
      <xs:enumeration value="save-update"/>
      <xs:enumeration value="update"/>
    </xs:restriction>
  </xs:simpleType>

  <xs:simpleType name="usage-attribute">
    <xs:restriction base="xs:token">
      <xs:enumeration value="nonstrict-read-write"/>
      <xs:enumeration value="read-only"/>
      <xs:enumeration value="read-write"/>
      <xs:enumeration value="transactional"/>
    </xs:restriction>
  </xs:simpleType>

</xs:schema>
New to GrepCode? Check out our FAQ X