<?xml version="1.0" encoding="UTF-8"?>
<!--
 Copyright 2003, 2004  The Apache Software Foundation
  
 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at
  
 http://www.apache.org/licenses/LICENSE-2.0
  
 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and
 limitations under the License.
-->
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xml:lang="EN"
    targetNamespace="http://ws.apache.org/jaxme/test/pm/session"
    xmlns:jm="http://ws.apache.org/jaxme/namespaces/jaxme2/schema"
    xmlns:jdm="http://ws.apache.org/jaxme/namespaces/jaxme2/jdbc-mapping"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified">
  <xs:annotation>
    <xs:documentation>
      This is an example demonstrating the JDBC mapping.
      It demonstrates the use of a table httpSession, as
      specified in the file "init.sql".
    </xs:documentation>
    <xs:appinfo>
    </xs:appinfo>
  </xs:annotation>

  <xs:element name="Session">
    <xs:annotation>
      <xs:documentation>
        This is an implementation of the SESSION table. The
        elements are read through JDBC.
      </xs:documentation>
      <xs:appinfo>
      </xs:appinfo>
    </xs:annotation>
    <xs:complexType>
      <xs:annotation><xs:appinfo>
        <jdm:table name="httpSession"/>
      </xs:appinfo></xs:annotation>
      <xs:sequence>
        <xs:element name="IpAddress" type="xs:string">
          <xs:annotation>
            <xs:documentation>
              A default for the spelling of "IpAddress". Without this default,
              the spelling would be choosen as provided by JDBC, typically
              uppercased.
            </xs:documentation>
          </xs:annotation>
        </xs:element>
        <xs:element name="LastAction" type="xs:dateTime">
          <xs:annotation>
            <xs:documentation>
              The element LastAction is stored in the database as a timestamp.
              However, we want it to have a certain property: It should be
              updated automatically with any update or insert to match the
              current time.
            </xs:documentation>
          </xs:annotation>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="Cookie">
        <xs:annotation>
          <xs:documentation>
            Just to demonstrate, that a database column can also
            be mapped to an attribute.
          </xs:documentation>
        </xs:annotation>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
</xs:schema>
