此版本仍在开发中,尚不被认为是稳定的。对于最新的稳定版本,请使用 Spring Framework 6.2.10spring-doc.cadn.net.cn

附录

XML 模式

附录的这一部分列出了用于数据访问的 XML 模式,包括以下内容:spring-doc.cadn.net.cn

tx图式

tx标签处理在 Spring 的全面支持中配置所有这些 bean对于事务。这些标签在标题为 事务管理 的章节中进行了介绍。spring-doc.cadn.net.cn

我们强烈建议您查看'spring-tx.xsd'文件,该文件附带Spring 发行版。该文件包含 Spring 事务的 XML 模式配置,并涵盖了tx命名空间,包括属性默认值和类似信息。此文件是内联记录的,因此,为了遵守 DRY(不要重复自己)原则,此处不重复该信息。

为了完整起见,使用txschema,您需要在 Spring XML 配置文件的顶部有以下前导码。中的文本following 代码片段引用了正确的模式,以便txNamespace 可供您:spring-doc.cadn.net.cn

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:tx="http://www.springframework.org/schema/tx" (1)
	xmlns:aop="http://www.springframework.org/schema/aop"
	xsi:schemaLocation="
		http://www.springframework.org/schema/beans
		https://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/tx
		https://www.springframework.org/schema/tx/spring-tx.xsd (2)
		http://www.springframework.org/schema/aop
		https://www.springframework.org/schema/aop/spring-aop.xsd">

	<!-- bean definitions here -->

</beans>
1 声明txNamespace。
2 指定位置(与其他架构位置)。
通常,当您使用tx命名空间,您还使用元素aop命名空间(因为 Spring 中的声明式事务支持是使用 AOP 实现)。前面的 XML 片段包含所需的相关行引用aopschema,以便aop命名空间可用给你。

jdbc图式

jdbc元素允许您快速配置嵌入式数据库或初始化现有数据源。这些元素分别记录在嵌入式数据库支持初始化数据源中。spring-doc.cadn.net.cn

要使用jdbcschema,您需要在Spring XML 配置文件的顶部。以下代码片段中的文本引用正确的模式,以便jdbc命名空间可供您使用:spring-doc.cadn.net.cn

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns:jdbc="http://www.springframework.org/schema/jdbc" (1)
	xsi:schemaLocation="
		http://www.springframework.org/schema/beans
		https://www.springframework.org/schema/beans/spring-beans.xsd
		http://www.springframework.org/schema/jdbc
		https://www.springframework.org/schema/jdbc/spring-jdbc.xsd"> (2)

	<!-- bean definitions here -->

</beans>
1 声明jdbcNamespace。
2 指定位置(与其他架构位置)。