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.1.xsd" />
10 <xsd:import namespace="http://www.springframework.org/schema/tool"
11 schemaLocation="http://www.springframework.org/schema/tool/spring-tool-3.1.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>
126 <xsd:attribute name="encoding" type="xsd:string">
128 <xsd:documentation><![CDATA[
129 The encoding for SQL scripts, if different from the platform encoding.
130 ]]></xsd:documentation>
133 <xsd:attribute name="separator" type="xsd:string">
135 <xsd:documentation><![CDATA[
136 The statement separator in the script (the default is to use ';' if it is present in the script, or '\n' otherwise).
137 ]]></xsd:documentation>
140 <xsd:attribute name="execution">
142 <xsd:documentation><![CDATA[
143 Indicate the timing of the execution of this script. Use INIT to execute on startup (as a bean initialization) and DESTROY to execute on shutdown (as a bean destruction callback).
144 ]]></xsd:documentation>
147 <xsd:restriction base="xsd:string">
148 <xsd:enumeration value="INIT"/>
149 <xsd:enumeration value="DESTROY"/>
155 <xsd:simpleType name="databaseType">
156 <xsd:restriction base="xsd:string">
157 <xsd:enumeration value="HSQL">
159 <xsd:documentation><![CDATA[
160 Hyper SQL Java Database Engine
161 ]]></xsd:documentation>
164 <xsd:enumeration value="H2">
166 <xsd:documentation><![CDATA[
167 H2 Java Database Engine
168 ]]></xsd:documentation>
171 <xsd:enumeration value="DERBY">
173 <xsd:documentation><![CDATA[
174 Derby Java Database Engine
175 ]]></xsd:documentation>