This part of the appendix lists XML schemas for data access, including the following:
附录的这一部分列出了数据访问的 XML 模式,包括以下内容:
tx Schema 7.1.1.tx 架构The tx tags deal with configuring all of those beans in Spring’s comprehensive support for transactions. These tags
are covered in the chapter entitled Transaction Management.
tx 标签用于配置 Spring 对事务的全面支持中的所有这些 bean。这些标签在名为“事务管理”的章节中有详细说明。
We strongly encourage you to look at the 'spring-tx.xsd' file that ships with the Spring distribution. This file
contains the XML Schema for Spring’s transaction configuration and covers all of the various elements in the tx
namespace, including attribute defaults and similar information. This file is documented inline, and, thus, the
information is not repeated here in the interests of adhering to the DRY (Don’t Repeat Yourself) principle.
我们强烈建议您查看随 Spring 发行版一起提供的 'spring-tx.xsd' 文件。此文件包含 Spring 事务配置的 XML Schema,并涵盖了
tx 命名空间中的所有各种元素,包括属性默认值和类似信息。此文件包含内联文档,因此出于遵循 DRY(不要重复自己)原则的考虑,此处不重复信息。
In the interest of completeness, to use the elements in the tx schema, you need to have the following preamble at the
top of your Spring XML configuration file. The text in the following snippet references the correct schema so that the
tags in the tx namespace are available to you:
为了完整性,要使用 tx 架构中的元素,您需要在 Spring XML 配置文件的顶部包含以下前缀。以下片段中的文本引用了正确的架构,以便您可以使用
tx 命名空间中的标签:
1
Declare usage of the tx namespace.
声明使用 tx 命名空间。
2
Specify the location (with other schema locations).
指定位置(与其他架构位置)。
Often, when you use the elements in the tx namespace, you are also using the elements from the aop namespace (since
the declarative transaction support in Spring is implemented by using AOP). The preceding XML snippet contains the
relevant lines needed to reference the aop schema so that the elements in the aop namespace are available to you.
通常,当您使用 tx 命名空间中的元素时,您也在使用 aop 命名空间中的元素(因为 Spring 中的声明式事务支持是通过使用 AOP
实现的)。前面的 XML 片段包含引用 aop 架构所需的相关行,以便您可以使用 aop 命名空间中的元素。
jdbc Schema 7.1.2.jdbc 架构The jdbc elements let you quickly configure an embedded database or initialize an existing data source. These elements
are documented in Embedded Database Support
and Initializing a DataSource, respectively.
jdbc 元素让您可以快速配置嵌入式数据库或初始化现有数据源。这些元素分别在嵌入式数据库支持和初始化数据源中进行文档说明。
To use the elements in the jdbc schema, you need to have the following preamble at the top of your Spring XML
configuration file. The text in the following snippet references the correct schema so that the elements in the jdbc
namespace are available to you:
要使用 jdbc 架构中的元素,您需要在 Spring XML 配置文件的顶部包含以下前缀。以下片段中的文本引用了正确的架构,以便您可以使用
jdbc 命名空间中的元素:
1
Declare usage of the jdbc namespace.
声明使用 jdbc 命名空间。
2
Specify the location (with other schema locations).
指定位置(与其他架构位置)。