JPA 2.1:EclipseLink:并非所有实体都被创建

时间:2016-03-28 12:54:54

标签: java jpa eclipselink

我正在使用JPA 2.1。 Eclipse链接作为JPA实现。

    The Persistence XML as follows:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
  <persistence-unit name="DSProductCatalogPU" transaction-type="JTA">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <jta-data-source>java:jboss/datasources/SampleDS</jta-data-source>

以下是POJO类中的@Entity注释

    <class>org.tmf.dsmapi.catalog.entity.catalog.CatalogEntity</class>
    <class>org.tmf.dsmapi.catalog.entity.category.CategoryEntity</class>
    <class>org.tmf.dsmapi.catalog.entity.product.ProductSpecificationEntity</class>
    <class>org.tmf.dsmapi.catalog.resource.product.ProductSpecification</class>

    <exclude-unlisted-classes>false</exclude-unlisted-classes>

    <properties>

      <property name="eclipselink.deploy-on-startup" value="true" />
      <property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>

    </properties>
  </persistence-unit>
</persistence>

正在创建一些实体。有些人没有被创造出来。

示例:创建了以下实体:CatalogEntity和CategoryEntity

示例:未创建以下实体:ProductSpecificationEntity和ProductSpecification

理想情况下,这四个表应该在服务器启动时创建。但事实并非如此。我使用Wild fly 10.0作为应用程序服务器。

有什么理由吗?

0 个答案:

没有答案