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

<xs:schema xmlns:ns2="http://www.mulesoft.org/schema/mule/devkit" xmlns:mule="http://www.mulesoft.org/schema/mule/core" xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified" targetNamespace="http://www.mulesoft.org/schema/mule/jpa">
  <xs:import namespace="http://www.w3.org/XML/1998/namespace"></xs:import>
  <xs:import schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.0.xsd" namespace="http://www.springframework.org/schema/beans"></xs:import>
  <xs:import schemaLocation="http://www.mulesoft.org/schema/mule/core/current/mule.xsd" namespace="http://www.mulesoft.org/schema/mule/core"></xs:import>
  <xs:element xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="config" substitutionGroup="mule:abstract-extension" ns2:javaClass="org.mule.module.jpa.adapters.JPAModuleProcessAdapter">
    <xs:complexType>
      <xs:complexContent>
        <xs:extension base="mule:abstractExtensionType">
          <xs:annotation>
            <xs:documentation>Java Persistence API (JPA) support for Mule.</xs:documentation>
          </xs:annotation>
          <xs:attribute name="name" use="optional" type="xs:string">
            <xs:annotation>
              <xs:documentation>Give a name to this configuration so it can be later referenced by config-ref.</xs:documentation>
            </xs:annotation>
          </xs:attribute>
          <xs:attribute name="entityManagerFactory-ref" use="required" type="xs:string">
            <xs:annotation>
              <xs:documentation>Reference to an &lt;code&gt;EntityManagerFactory&lt;/code&gt;</xs:documentation>
            </xs:annotation>
          </xs:attribute>
        </xs:extension>
      </xs:complexContent>
    </xs:complexType>
  </xs:element>
  <xs:element xmlns="http://www.mulesoft.org/schema/mule/jpa" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="query" substitutionGroup="mule:abstract-message-processor" type="QueryType">
    <xs:annotation>
      <xs:documentation>Execute a JPA query. If the payload of the message is a &lt;code&gt;List&lt;/code&gt; or &lt;code&gt;Map&lt;/code&gt; then its used
as the query parameters.  If neither statement nor namedQuery are set then the payload of the message is assumed
to be a &lt;code&gt;CriteriaQuery&lt;/code&gt; instance.
&lt;p/&gt;</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="QueryType">
    <xs:complexContent>
      <xs:extension xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:abstractMessageProcessorType">
        <xs:attribute name="config-ref" use="optional" type="xs:string">
          <xs:annotation>
            <xs:documentation>Specify which configuration to use for this invocation.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="criteria-ref" use="optional" type="xs:string">
          <xs:annotation>
            <xs:documentation>the CriteriaQuery</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="statement" use="optional" type="xs:string">
          <xs:annotation>
            <xs:documentation>a JPA QL statement to execute</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="namedQuery" use="optional" type="xs:string">
          <xs:annotation>
            <xs:documentation>a named query to execute</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="queryParameters-ref" use="optional" type="xs:string">
          <xs:annotation>
            <xs:documentation>the query parameters</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/jpa" name="flush" default="false" use="optional" type="booleanType">
          <xs:annotation>
            <xs:documentation>flush the session if true</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element xmlns="http://www.mulesoft.org/schema/mule/jpa" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="persist" substitutionGroup="mule:abstract-message-processor" type="PersistType">
    <xs:annotation>
      <xs:documentation>Persists the payload of the message.
&lt;p/&gt;</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="PersistType">
    <xs:complexContent>
      <xs:extension xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:abstractMessageProcessorType">
        <xs:attribute name="config-ref" use="optional" type="xs:string">
          <xs:annotation>
            <xs:documentation>Specify which configuration to use for this invocation.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="entity-ref" use="required" type="xs:string">
          <xs:annotation>
            <xs:documentation>The entity to persist.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/jpa" name="flush" default="false" use="optional" type="booleanType">
          <xs:annotation>
            <xs:documentation>flush the session if true</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element xmlns="http://www.mulesoft.org/schema/mule/jpa" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="merge" substitutionGroup="mule:abstract-message-processor" type="MergeType">
    <xs:annotation>
      <xs:documentation>Merges the payload of the message.
&lt;p/&gt;</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="MergeType">
    <xs:complexContent>
      <xs:extension xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:abstractMessageProcessorType">
        <xs:attribute name="config-ref" use="optional" type="xs:string">
          <xs:annotation>
            <xs:documentation>Specify which configuration to use for this invocation.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="entity-ref" use="required" type="xs:string">
          <xs:annotation>
            <xs:documentation>The entity to persist.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/jpa" name="flush" default="false" use="optional" type="booleanType">
          <xs:annotation>
            <xs:documentation>flush the session if true</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element xmlns="http://www.mulesoft.org/schema/mule/jpa" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="find" substitutionGroup="mule:abstract-message-processor" type="FindType">
    <xs:annotation>
      <xs:documentation>Looks up an entity using the message's payload as the primary key.
&lt;p/&gt;</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="FindType">
    <xs:complexContent>
      <xs:extension xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:abstractMessageProcessorType">
        <xs:attribute name="config-ref" use="optional" type="xs:string">
          <xs:annotation>
            <xs:documentation>Specify which configuration to use for this invocation.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="entityClass" use="required" type="xs:string">
          <xs:annotation>
            <xs:documentation>The class of the entity to find.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="id-ref" use="required" type="xs:string">
          <xs:annotation>
            <xs:documentation>The ID of the entity to find.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/jpa" name="flush" default="false" use="optional" type="booleanType">
          <xs:annotation>
            <xs:documentation>flush the session if true</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:element xmlns="http://www.mulesoft.org/schema/mule/jpa" xmlns:mule="http://www.mulesoft.org/schema/mule/core" name="detach" substitutionGroup="mule:abstract-message-processor" type="DetachType">
    <xs:annotation>
      <xs:documentation>Detaches the message's payload from the session.
&lt;p/&gt;</xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="DetachType">
    <xs:complexContent>
      <xs:extension xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:abstractMessageProcessorType">
        <xs:attribute name="config-ref" use="optional" type="xs:string">
          <xs:annotation>
            <xs:documentation>Specify which configuration to use for this invocation.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute name="entity-ref" use="required" type="xs:string">
          <xs:annotation>
            <xs:documentation>The entity to detach.</xs:documentation>
          </xs:annotation>
        </xs:attribute>
        <xs:attribute xmlns="http://www.mulesoft.org/schema/mule/jpa" name="flush" default="false" use="optional" type="booleanType">
          <xs:annotation>
            <xs:documentation>flush the session if true</xs:documentation>
          </xs:annotation>
        </xs:attribute>
      </xs:extension>
    </xs:complexContent>
  </xs:complexType>
  <xs:simpleType name="integerType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:integer"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:propertyPlaceholderType"></xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="decimalType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:decimal"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:propertyPlaceholderType"></xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="floatType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:float"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:propertyPlaceholderType"></xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="doubleType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:double"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:propertyPlaceholderType"></xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="dateTimeType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:dateTime"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:propertyPlaceholderType"></xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="longType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:long"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:propertyPlaceholderType"></xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="byteType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:byte"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:propertyPlaceholderType"></xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="booleanType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:boolean"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:propertyPlaceholderType"></xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="anyUriType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:anyURI"></xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:propertyPlaceholderType"></xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
  <xs:simpleType name="charType">
    <xs:union>
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:minLength value="1"></xs:minLength>
          <xs:maxLength value="1"></xs:maxLength>
        </xs:restriction>
      </xs:simpleType>
      <xs:simpleType>
        <xs:restriction xmlns:mule="http://www.mulesoft.org/schema/mule/core" base="mule:propertyPlaceholderType"></xs:restriction>
      </xs:simpleType>
    </xs:union>
  </xs:simpleType>
</xs:schema>