<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsd:schema xmlns="http://www.mulesource.org/schema/mule/jdbc/2.0"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:mule="http://www.mulesource.org/schema/mule/core/2.0"
            targetNamespace="http://www.mulesource.org/schema/mule/jdbc/2.0"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">

    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    <xsd:import namespace="http://www.mulesource.org/schema/mule/core/2.0"
                schemaLocation="http://www.mulesource.org/schema/mule/core/2.0/mule.xsd" />

    <xsd:element name="connector" type="jdbcConnectorType" substitutionGroup="mule:abstract-connector"/>

    <xsd:complexType name="jdbcConnectorType">
        <xsd:complexContent>
            <xsd:extension base="mule:connectorType">
                <xsd:group ref="queryElements"/>
                <xsd:attribute name="pollingFrequency" type="mule:substitutableLong" />
                <xsd:attribute name="dataSource-ref" type="xsd:NMTOKEN" use="required"/>
                <xsd:attribute name="queryRunner-ref" type="xsd:NMTOKEN"/>
                <xsd:attribute name="resultSetHandler-ref" type="xsd:NMTOKEN"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="inbound-endpoint" type="inboundEndpointType" substitutionGroup="mule:abstract-inbound-endpoint"/>
    <xsd:complexType name="inboundEndpointType">
        <xsd:complexContent>
            <xsd:extension base="mule:inboundEndpointType">
                <xsd:group ref="queryElements"/>
                <xsd:attributeGroup ref="addressAttributes"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="outbound-endpoint" type="outboundEndpointType" substitutionGroup="mule:abstract-outbound-endpoint"/>
    <xsd:complexType name="outboundEndpointType">
        <xsd:complexContent>
            <xsd:extension base="mule:outboundEndpointType">
                <xsd:group ref="queryElements"/>
                <xsd:attributeGroup ref="addressAttributes"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:element name="endpoint" type="globalEndpointType" substitutionGroup="mule:abstract-global-endpoint"/>
    <xsd:complexType name="globalEndpointType">
        <xsd:complexContent>
            <xsd:extension base="mule:globalEndpointType">
                <xsd:group ref="queryElements"/>
                <xsd:attributeGroup ref="addressAttributes"/>
            </xsd:extension>
        </xsd:complexContent>
    </xsd:complexType>

    <xsd:attributeGroup name="addressAttributes">
        <xsd:attribute name="queryKey" type="xsd:string"/>
        <xsd:attribute name="pollingFrequency" type="mule:substitutableLong"/>
    </xsd:attributeGroup>

    <xsd:element name="transaction" type="mule:baseTransactionType" substitutionGroup="mule:abstract-transaction"/>

    <xsd:group name="queryElements">
        <xsd:sequence>
            <xsd:element name="query" type="mule:keyValueType" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
    </xsd:group>

</xsd:schema>
