1 <?xml version="1.0" encoding="UTF-8" ?>
2 <xsd:schema xmlns="http://www.springframework.org/schema/jdbc"
3 xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:beans="http://www.springframework.org/schema/beans"
4 xmlns:tool="http://www.springframework.org/schema/tool"
5 targetNamespace="http://www.springframework.org/schema/jdbc"
6 elementFormDefault="qualified" attributeFormDefault="unqualified">
8 <xsd:import namespace="http://www.springframework.org/schema/beans"
9 schemaLocation="http://www.springframework.org/schema/beans/spring-beans-3.0.xsd" />
10 <xsd:import namespace="http://www.springframework.org/schema/tool"
11 schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.0.xsd" />
13 <xsd:element name="embedded-database">
15 <xsd:documentation source="java:org.springframework.jdbc.datasource.embedded.EmbeddedDatabaseFactoryBean"><![CDATA[
16 Creates an embedded database instance and makes it available to other beans as a javax.sql.DataSource.
17 ]]></xsd:documentation>
20 <tool:exports type="javax.sql.DataSource"/>
26 <xsd:extension base="beans:identifiedType">
28 <xsd:element name="script" type="scriptType" minOccurs="0" maxOccurs="unbounded">
30 <xsd:documentation><![CDATA[
31 A SQL script to execute during embedded database initialization.
32 ]]></xsd:documentation>
36 <xsd:attribute name="type" type="databaseType" default="HSQL">
38 <xsd:documentation><![CDATA[
39 The type of embedded database to create, such as HSQL, H2 or Derby. Defaults to HSQL.
40 ]]></xsd:documentation>
48 <xsd:element name="initialize-database">
50 <xsd:documentation source="java:org.springframework.jdbc.datasource.init.DataSourceInitializer"><![CDATA[
51 Initializes a database instance with SQL scripts provided in nested <script/> elements.
52 ]]></xsd:documentation>
56 <xsd:element name="script" type="scriptType" minOccurs="1" maxOccurs="unbounded">
58 <xsd:documentation><![CDATA[
59 A SQL script to execute during database initialization.
60 ]]></xsd:documentation>
64 <xsd:attribute name="data-source" type="xsd:string" default="dataSource">
66 <xsd:documentation><![CDATA[
67 A reference to a data source that should be initialized. Defaults to "dataSource".
68 ]]></xsd:documentation>
70 <tool:annotation kind="ref"/>
71 <tool:expected-type type="javax.sql.DataSource"/>
75 <xsd:attribute name="enabled" type="xsd:string" use="optional" default="true">
78 Is this bean "enabled", meaning the scripts will be executed?
79 Defaults to true, but can be used to switch on and off the initialization depending on the environment.
83 <xsd:attribute name="ignore-failures" use="optional" default="NONE">
86 Should failed SQL statements be ignored during initialization?
90 <xsd:restriction base="xsd:string">
91 <xsd:enumeration value="NONE">
93 <xsd:documentation><![CDATA[
94 Do not ignore failures (the default)
95 ]]></xsd:documentation>
98 <xsd:enumeration value="DROPS">
100 <xsd:documentation><![CDATA[
101 Ignore failed DROP statements
102 ]]></xsd:documentation>
105 <xsd:enumeration value="ALL">
107 <xsd:documentation><![CDATA[
109 ]]></xsd:documentation>
118 <xsd:complexType name="scriptType">
119 <xsd:attribute name="location" type="xsd:string">
121 <xsd:documentation><![CDATA[
122 The resource location of an SQL script to execute. Can be a single script location or a pattern (e.g. classpath:/com/foo/sql/*-data.sql).
123 ]]></xsd:documentation>
128 <xsd:simpleType name="databaseType">
129 <xsd:restriction base="xsd:string">
130 <xsd:enumeration value="HSQL">
132 <xsd:documentation><![CDATA[
133 Hyper SQL Java Database Engine
134 ]]></xsd:documentation>
137 <xsd:enumeration value="H2">
139 <xsd:documentation><![CDATA[
140 H2 Java Database Engine
141 ]]></xsd:documentation>
144 <xsd:enumeration value="DERBY">
146 <xsd:documentation><![CDATA[
147 Derby Java Database Engine
148 ]]></xsd:documentation>