persistence.xml schema 参考

31 篇文章 0 订阅

 

persistence.xml文件要打包到EJB Jar文件的META-INF目录。
persistence.xml文件用于指定实体Bean使用的数据源及EntityManager对象的默认行为。
persistence.xml文件的配置说明如下:
Xml代码
<persistence> 
<persistence-unit name="foshanshop"> 
<jta-data-source>java:/DefaultMySqlDS</jta-data-source> 
<properties> 
<property name="hibernate.hbm2ddl.auto" value="create-drop"/> 
</properties> 
</persistence-unit> 
</persistence> 

<persistence>
<persistence-unit name="foshanshop">
<jta-data-source>java:/DefaultMySqlDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
</properties>
</persistence-unit>
</persistence>

persistence-unit节点可以有一个或多个,每个persistence-unit节点定义了持久化内容名称、使用的数据源及持久化产品专有属性。name 属性定义持久化名称。jta-data-source 节点指定实体Bean使用的数据源JNDI 名称,如果应用发布在jboss下数据源名称必须带有java:/前缀,数据源
名称大小写敏感。properties节点用作指定持久化产品的各项属性,各个应用服务器使用的持久化产品都不一样如Jboss使用 Hibernate,weblogic10使用Kodo,glassfish/sun application server/Oralce使用Toplink。

因为jboss 采用Hibernate,Hibernate 有一项属性hibernate.hbm2ddl.auto,该属性指定实体Bean发布时是否同步数据库结构,如果 hibernate.hbm2ddl.auto的值设为create-drop,在实体Bean发布及卸载时将自动创建及删除相应数据库表(注意:Jboss 服务器启动或关闭时也会引发实体Bean 的发布及卸载)。TopLink产品的toplink.ddl-generation属性也起到同样的作用。


     小提示:如果你的表已经存在,并且想保留数据,发布实体bean 时可以把hibernate.hbm2ddl.auto 的值设为none或update,以后为了实体bean的改动能反应到数据表,建议使用update,这样实体Bean 添加一个属性时能同时在数据表增加相应字段。
()

3. Persistence.xml 配置说明

 

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

<persistence version="1.0"
xmlns:persistence="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence persistence_1_0.xsd ">


<!--
     Name属性用于定义持久化单元的名字 (name必选,空值也合法);
     transaction-type 指定事务类型(可选)
-->
<persistence-unit name="unitName" transaction-type="JTA">


   <!-- 描述信息.(可选) -->
   <description> </description>

   <!-- javax.persistence.PersistenceProvider接口的一个实现类(可选) -->
   <provider>   </provider>

   <!-- Jta-data-source和 non-jta-data-source用于分别指定持久化提供商使用的JTA和/或non-JTA数据源的全局JNDI名称(可选) -->
   <jta-data-source>java:/MySqlDS</jta-data-source>
   <non-jta-data-source> </non-jta-data-source>

   <!-- 声明orm.xml所在位置.(可选) -->
   <mapping-file>product.xml</mapping-file>

   <!-- 以包含persistence.xml的jar文件为基准的相对路径,添加额外的jar文件.(可选) -->
   <jar-file>../lib/model.jar</jar-file>

   <!-- 显式列出实体类,在Java SE 环境中应该显式列出.(可选) -->
   <class>com.domain.User</class>
   <class>com.domain.Product</class>

   <!-- 声明是否扫描jar文件中标注了@Enity类加入到上下文.若不扫描,则如下:(可选) -->
   <exclude-unlisted-classes/>

   <!--   厂商专有属性(可选)   -->
   <properties>
    <!-- hibernate.hbm2ddl.auto= create-drop / create / update -->
    <property name="hibernate.hbm2ddl.auto" value="update" />
    <property name="hibernate.show_sql" value="true" />
   </properties>

</persistence-unit>
</persistence>
 
()
 配置文件:persistence.xml-----beans.xml----jdbc.properties----log4j.properties---oscache----paoding---struts.config---web.xml 收藏
<?xml version="1.0"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
  <persistence-unit name="itcast" transaction-type="RESOURCE_LOCAL">
   <provider>org.hibernate.ejb.HibernatePersistence</provider>
 <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
   <property name="hibernate.max_fetch_depth" value="3"/>
         <property name="hibernate.hbm2ddl.auto" value="update"/>
      <property name="hibernate.jdbc.fetch_size" value="18"/>
      <property name="hibernate.jdbc.batch_size" value="10"/>
      <property name="hibernate.show_sql" value="false"/>
      <property name="hibernate.format_sql" value="false"/>
      </properties>
  </persistence-unit>
</persistence>

---------------------------------------------------------------

<?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:context="http://www.springframework.org/schema/context"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
           http://www.springframework.org/schema/context
           http://www.springframework.org/schema/context/spring-context-2.5.xsd
           http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
           http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
 <aop:aspectj-autoproxy/>
 <context:component-scan base-package="cn.itcast"/>
    <!--  使用数据源和指定persistence.xml位置的方式创建entityManagerFactory,如果使用的不是hibernate JPA实现,
    需要在tomcat作一些特殊配置.具体参考手册
    注意:使用该方式需要把persistence.xml中的hibernate.connection.driver_class,hibernate.connection.username,hibernate.connection.password,hibernate.connection.url配置删除
   -->
    <context:property-placeholder location="classpath:jdbc.properties"/>
 <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
  <property name="driverClass" value="${driverClass}"/>
  <property name="jdbcUrl" value="${jdbcUrl}" />
  <property name="user" value="${user}" />
  <property name="password" value="${password}"/>
  <!--连接池中保留的最小连接数。-->
  <property name="minPoolSize" value="${minPoolSize}"/>
  <!--连接池中保留的最大连接数。Default: 15 -->
  <property name="maxPoolSize" value="${maxPoolSize}" />
  <!--初始化时获取的连接数,取值应在minPoolSize与maxPoolSize之间。Default: 3 -->
  <property name="initialPoolSize" value="${initialPoolSize}"/>
  <!--最大空闲时间,60秒内未使用则连接被丢弃。若为0则永不丢弃。Default: 0 -->
  <property name="maxIdleTime" value="${maxIdleTime}" />
  <!--当连接池中的连接耗尽的时候c3p0一次同时获取的连接数。Default: 3 -->
  <property name="acquireIncrement" value="${acquireIncrement}" />
 </bean>
 <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
  <property name="dataSource" ref="dataSource" />
  <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml" />
  <property name="loadTimeWeaver">
          <bean class="org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver"/>
     </property>
 </bean>
 
   <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory"/>
   </bean>
  
   <tx:annotation-driven transaction-manager="transactionManager"/>
 
   <bean id="compass" class="org.compass.spring.LocalCompassBean">
  <property name="classMappings">
   <list>
    <value>cn.xxx.bean.product.ProductInfo</value>
    <value>cn.xxx.bean.product.Brand</value>
    <value>cn.xxx.bean.product.ProductStyle</value>
    <value>cn.xxx.bean.product.ProductType</value>
   </list>
  </property>
  <property name="compassSettings">
   <props>
    <prop key="compass.engine.analyzer.default.type">net.paoding.analysis.analyzer.PaodingAnalyzer</prop>
    <prop key="compass.engine.connection">file://d:/index</prop>
    <!-- 在内存中建立索引
    <prop key="compass.engine.connection">ram://index</prop>
    -->
    <prop key="compass.engine.highlighter.default.formatter.simple.pre"><![CDATA[<font color='red'>]]></prop>
    <prop key="compass.engine.highlighter.default.formatter.simple.post"><![CDATA[</font>]]></prop>
    <prop key="compass.transaction.factory">org.compass.spring.transaction.SpringSyncTransactionFactory</prop>
   </props>
  </property>
  <property name="transactionManager" ref="transactionManager" />
 </bean>
 <!-- 自动完成 索引的添加/更新/删除操作-->
 <bean id="compassGps" class="org.compass.gps.impl.SingleCompassGps" init-method="start" destroy-method="stop">
  <property name="compass" ref="compass" />
  <property name="gpsDevices">
   <list>
    <!-- 设置JPA驱动 -->
    <bean class="org.compass.gps.device.jpa.JpaGpsDevice">
      <property name="name" value="jpaDevice" />
      <property name="entityManagerFactory" ref="entityManagerFactory" />
      <property name="injectEntityLifecycleListener" value="true"/>
    </bean>
   </list>
  </property>
 </bean>
</beans>

-----------------------------------------------------------------------

driverClass=org.gjt.mm.mysql.Driver
jdbcUrl=jdbc:mysql://localhost:3306/itcast?useUnicode=true&characterEncoding=UTF-8
user=root
password=123456
minPoolSize=5
maxPoolSize=200
initialPoolSize=5
maxIdleTime=60
acquireIncrement=5

 

()
 配置persistence.xml

映射了数据库中的表和对应的实体类,JPA需要使用persistence.xml来配置这些实体类由哪个实体管理器负责管理。

persistence.xml的配置代码如下所示。

http://java.sun.com/xml/ns/persistence"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://java.sun.com/xml/ns/persistencehttp://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"version="1.0"> org.hibernate.ejb.HibernatePersistencejava:/jpaDemovalue="org.hibernate.dialect.HSQLDialect" /> 这里需要对persistence.xml文件进行说明,如下所示。·persistence.xml是一个XML文件,它的文档定义Schema可以从http://java.sun.com/xml/ ns/persistence/persistence_1_0.xsd下载到。·persistence.xml文件打成JAR包后,必须保存在META-INF文件目录下。有关打包的内容请读者参阅下文内容。·元素中由一个或多个组成。每一个表示对应的一个实体管理器。·中,name表示实体管理器的名称,在SessionBean中可以通过注释来获得该实体管理器。transaction-type定义了实体管理器事务处理的策略,本例中设置为“JTA”表示使用容器的事务处理。·元素说明该实体管理器是由第三方的实现名称。本例中使用的是Hibernate的实现,所以设置为“org.hibernate.ejb.HibernatePersistence”。·元素定义了该实体管理器所连接的数据源,例如这里使用的是DataSource来访问数据库的,本里中“java:/jpaDemo”表示,数据源名为“jpaDemo”。稍后将对如何在JBoss中配置数据源作详细的介绍。·中的设置的属性是根据不同的第三方
实现JPA来定义
()
EJB3 entity bean需要的配置文件persistence.xml

ejb   2008-11-13 10:58   阅读128   评论0   字号: 大大  中中  小小 persistence.xml文件要打包到EJB Jar文件的META-INF目录。
 
persistence.xml文件用于指定实体Bean使用的数据源及EntityManager对象的默认行为。
 
persistence.xml文件的配置说明如下:
 
<persistence>
<persistence-unit name="foshanshop">
<jta-data-source>java:/DefaultMySqlDS</jta-data-source>
<properties>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
</properties>
</persistence-unit>
</persistence>
 
persistence-unit节点可以有一个或多个,每个persistence-unit节点定义了持久化内容名称、使用的数据源及持久化产品专有属性。name 属性定义持久化名称。jta-data-source 节点指定实体Bean使用的数据源JNDI 名称,如果应用发布在jboss下数据源名称必须带有java:/前缀,数据源
名称大小写敏感。properties节点用作指定持久化产品的各项属性,各个应用服务器使用的持久化产品都不一样如Jboss使用Hibernate,weblogic10使用Kodo,glassfish/sun application server/Oralce使用Toplink。
 
因为jboss 采用Hibernate,Hibernate 有一项属性hibernate.hbm2ddl.auto,该属性指定实体Bean发布时是否同步数据库结构,如果hibernate.hbm2ddl.auto的值设为create-drop,在实体Bean发布及卸载时将自动创建及删除相应数据库表(注意:Jboss 服务器启动或关闭时也会引发实体Bean 的发布及卸载)。TopLink产品的toplink.ddl-generation属性也起到同样的作用。
 
的。不同的JPA实现有不同的配置

()
在spring配置下使用hibernate实现的JPA。我的两个jar文件jar1.jar和jar2.jar同放在tomcat/common/lib下。我的persistence.xm放在jar1.jar的META-INF中。现想在jar1.jar中的persistence.xml通过使用<jar-file>来引入jar2.jar中的持久化类,做了如下尝试:
(1)persistence.xml如下
<persistence-unit name="XxxPU">
        <jar-file>jar2.jar</jar-file>
</persistence-unit>
结果是
java.io.FileNotFoundException: ServletContext resource [/jar2.jar] cannot be resolved to URL because it does not exist.
如此看来spring使用WebApplicationContext,从而引入的文件都是以web应用的根为根的,此方法不可行。
(2)persistence.xml如下
<persistence-unit name="XxxPU">
        <jar-file>file:jar2.jar</jar-file>
</persistence-unit>
结果是
java.io.FileNotFoundException: jar2.jar (系统找不到指定的文件。)
如此看来file:前缀也只是让spring从用户目录即程序启动文件夹搜索jar,此方法亦不可行。

根据JPA标准中所述:
One or more JAR files may be specified using the jar-file elements ...Such JAR files are specified relative to the root of the persistence unit (e.g., utils/myUtils.jar).(138页第2段)
可以使用jar-file元素来指定一个或多个jar文件……这些jar文件的指定是相对于persistence unit的根的。
A persistence unit is defined by a persistence.xml file. The jar file or directory whose META-INF directory contains the persistence.xml file is termed the root of the persistence unit.(134页第3段)
persistence unit在persistence.xml文件中定义。META-INF目录中包含persistence.xml文件的jar文件或目录被视作persistence unit的根。

如此看来jar1.jar就是我的persistence unit的根,而指定同目录下的jar2.jar直接写<jar-file>jar2.jar</jar-file>即可。然而spring却在加不加“file:”前缀的情况下都无法满足标准中的约定,让我不知如何是好。

经查阅又发现标准中如下这段:
It is not required that an EJB-JAR or WAR containing a persistence unit be packaged in an EAR unless
the persistence unit contains persistence classes in addition to those contained in the EJB-JAR or WAR.
See Section 6.2.1.6.(134页倒数第5段)
包含persistence unit的EJB-JAR或WAR不一定要打包在EAR中,除非该persistence unit包含了该EJB-JAR或WAR以外的持久化类。

这句话的意思是不是就是说如果我想要使用<jar-file>标签来引入一个jar文件的话,就必须把这两个jar都打包在EAR中呢?那么我要在tomcat下使用spring配置来实现JPA的jar包含就没有办法了吗?请高手们指教,谢谢!
问题补充:
Such JAR files are specified relative to the root of the persistence unit
问题就在于Spring没有遵循标准中的这句话,
org.springframework.orm.jpa.persistenceunit.PersistenceUnitReader中解析jar-file部分的源代码如下
Java代码
for (Element element : jars) {  
    String value = DomUtils.getTextValue(element).trim();  
    if (StringUtils.hasText(value)) {  
        Resource[] resources = this.resourcePatternResolver  
                .getResources(value);  
        for (int i = 0; i < resources.length; i++) {  
            unitInfo.addJarFileUrl(resources[i].getURL());  
        }  
    }  

for (Element element : jars) {
 String value = DomUtils.getTextValue(element).trim();
 if (StringUtils.hasText(value)) {
  Resource[] resources = this.resourcePatternResolver
    .getResources(value);
  for (int i = 0; i < resources.length; i++) {
   unitInfo.addJarFileUrl(resources[i].getURL());
  }
 }
}
它使用spring的Resource机制来解析jar-file元素中的资源,导致了我描述的问题。
现在我在思考除了修改spring的源代码之外是否还有其它解决方法。

 

()

<!-- persistence.xml schema  -->
-<xsd:schema targetNamespace="
http://java.sun.com/xml/ns/persistence"
elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
-<xsd:annotation>
 <xsd:documentation> @(#)persistence_1_0.xsd 1.0 Feb 9 2006 </xsd:documentation>
 </xsd:annotation>
-<xsd:annotation>
 <xsd:documentation> DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. Copyright 2005-2007 Sun Microsystems, Inc. All rights reserved. The contents of this file are subject to the terms of either the GNU General Public License Version 2 only ("GPL") or the Common Development and Distribution License("CDDL") (collectively, the "License"). You may not use this file except in compliance with the License. You can obtain a copy of the License at
https://glassfish.dev.java.net/public/CDDL+GPL.html or glassfish/bootstrap/legal/LICENSE.txt. See the License for the specific language governing permissions and limitations under the License. When distributing the software, include this License Header Notice in each file and include the License file at glassfish/bootstrap/legal/LICENSE.txt. Sun designates this particular file as subject to the "Classpath" exception as provided by Sun in the GPL Version 2 section of the License file that accompanied this code. If applicable, add the following below the License Header, with the fields enclosed by brackets [] replaced by your own identifying information: "Portions Copyrighted [year] [name of copyright owner]" Contributor(s): If you wish your version of this file to be governed by only the CDDL or only the GPL Version 2, indicate your decision by adding "[Contributor] elects to include this software in this distribution under the [CDDL or GPL Version 2] license." If you don't indicate a single choice of license, a recipient has the option to distribute your version of this file under either the CDDL, the GPL Version 2 or to extend the choice of license to its licensees as provided above. However, if you add GPL Version 2 code and therefore, elected the GPL Version 2 license, then the option applies only if the new code is made subject to such option by the copyright holder. </xsd:documentation>
 </xsd:annotation>
-<xsd:annotation>
 <xsd:documentation> This is the XML Schema for the persistence configuration file. The file must be named "META-INF/persistence.xml" in the persistence archive. Persistence configuration files must indicate the persistence schema by using the persistence namespace:
http://java.sun.com/xml/ns/persistence and indicate the version of the schema by using the version element as shown below:

 <persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
 http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">


... </persistence> </xsd:documentation>
 </xsd:annotation>
-<xsd:simpleType name="versionType">
-<xsd:restriction base="xsd:token">
 <xsd:pattern value="[0-9]+(/.[0-9]+)*"/>
 </xsd:restriction>
 </xsd:simpleType>
-<!-- ****************************************************  -->
-<xsd:element name="persistence">
-<xsd:complexType>
-<xsd:sequence>
-<!-- ****************************************************  -->
-<xsd:element name="persistence-unit" minOccurs="0" maxOccurs="unbounded">
-<xsd:complexType>
-<xsd:annotation>
 <xsd:documentation> Configuration of a persistence unit. </xsd:documentation>
 </xsd:annotation>
-<xsd:sequence>
-<!-- ****************************************************  -->
-<xsd:element name="description" type="xsd:string" minOccurs="0">
-<xsd:annotation>
 <xsd:documentation> Textual description of this persistence unit. </xsd:documentation>
 </xsd:annotation>
 </xsd:element>
-<!-- ****************************************************  -->
-<xsd:element name="provider" type="xsd:string" minOccurs="0">
-<xsd:annotation>
 <xsd:documentation> Provider class that supplies EntityManagers for this persistence unit. </xsd:documentation>
 </xsd:annotation>
 </xsd:element>
-<!-- ****************************************************  -->
-<xsd:element name="jta-data-source" type="xsd:string" minOccurs="0">
-<xsd:annotation>
 <xsd:documentation> The container-specific name of the JTA datasource to use. </xsd:documentation>
 </xsd:annotation>
 </xsd:element>
-<!-- ****************************************************  -->
-<xsd:element name="non-jta-data-source" type="xsd:string" minOccurs="0">
-<xsd:annotation>
 <xsd:documentation> The container-specific name of a non-JTA datasource to use. </xsd:documentation>
 </xsd:annotation>
 </xsd:element>
-<!-- ****************************************************  -->
-<xsd:element name="mapping-file" type="xsd:string" minOccurs="0" maxOccurs="unbounded">
-<xsd:annotation>
 <xsd:documentation> File containing mapping information. Loaded as a resource by the persistence provider. </xsd:documentation>
 </xsd:annotation>
 </xsd:element>
-<!-- ****************************************************  -->
-<xsd:element name="jar-file" type="xsd:string" minOccurs="0" maxOccurs="unbounded">
-<xsd:annotation>
 <xsd:documentation> Jar file that should be scanned for entities. Not applicable to Java SE persistence units. </xsd:documentation>
 </xsd:annotation>
 </xsd:element>
-<!-- ****************************************************  -->
-<xsd:element name="class" type="xsd:string" minOccurs="0" maxOccurs="unbounded">
-<xsd:annotation>
 <xsd:documentation> Class to scan for annotations. It should be annotated with either @Entity, @Embeddable or @MappedSuperclass. </xsd:documentation>
 </xsd:annotation>
 </xsd:element>
-<!-- ****************************************************  -->
-<xsd:element name="exclude-unlisted-classes" type="xsd:boolean" default="false" minOccurs="0">
-<xsd:annotation>
 <xsd:documentation> When set to true then only listed classes and jars will be scanned for persistent classes, otherwise the enclosing jar or directory will also be scanned. Not applicable to Java SE persistence units. </xsd:documentation>
 </xsd:annotation>
 </xsd:element>
-<!-- ****************************************************  -->
-<xsd:element name="properties" minOccurs="0">
-<xsd:annotation>
 <xsd:documentation> A list of vendor-specific properties. </xsd:documentation>
 </xsd:annotation>
-<xsd:complexType>
-<xsd:sequence>
-<xsd:element name="property" minOccurs="0" maxOccurs="unbounded">
-<xsd:annotation>
 <xsd:documentation> A name-value pair. </xsd:documentation>
 </xsd:annotation>
-<xsd:complexType>
 <xsd:attribute name="name" type="xsd:string" use="required"/>
 <xsd:attribute name="value" type="xsd:string" use="required"/>
 </xsd:complexType>
 </xsd:element>
 </xsd:sequence>
 </xsd:complexType>
 </xsd:element>
 </xsd:sequence>
-<!-- ****************************************************  -->
-<xsd:attribute name="name" type="xsd:string" use="required">
-<xsd:annotation>
 <xsd:documentation> Name used in code to reference this persistence unit. </xsd:documentation>
 </xsd:annotation>
 </xsd:attribute>
-<!-- ****************************************************  -->
-<xsd:attribute name="transaction-type" type="persistence:persistence-unit-transaction-type">
-<xsd:annotation>
 <xsd:documentation> Type of transactions used by EntityManagers from this persistence unit. </xsd:documentation>
 </xsd:annotation>
 </xsd:attribute>
 </xsd:complexType>
 </xsd:element>
 </xsd:sequence>
 <xsd:attribute name="version" type="persistence:versionType" fixed="1.0" use="required"/>
 </xsd:complexType>
 </xsd:element>
-<!-- ****************************************************  -->
-<xsd:simpleType name="persistence-unit-transaction-type">
-<xsd:annotation>
 <xsd:documentation> public enum TransactionType { JTA, RESOURCE_LOCAL }; </xsd:documentation>
 </xsd:annotation>
-<xsd:restriction base="xsd:token">
 <xsd:enumeration value="JTA"/>
 <xsd:enumeration value="RESOURCE_LOCAL"/>
 </xsd:restriction>
 </xsd:simpleType>
 </xsd:schema>

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值