Java Eclipselink,@OneToMany不能使用schema generation=drop and create
经过大量研究,我终于找到了失败的原因 使用Eclipselink时,Java Eclipselink,@OneToMany不能使用schema generation=drop and create,java,jpa,schema,eclipselink,one-to-many,Java,Jpa,Schema,Eclipselink,One To Many,经过大量研究,我终于找到了失败的原因 使用Eclipselink时,@OneToMany在persistence.xml包含以下内容时不起作用(返回null): (拖放并创建) 注意:@OneToMany可以正确使用Hibernate 有人能解决这个问题吗?你能描述一下你所说的“工作正常”和“不工作”是什么意思吗?没有任何信息可以说明问题出在哪里,您也没有显示实体,甚至没有提到问题是否出在创建的表上。您能描述一下您所说的“工作正常”和“不工作”吗?没有任何信息可以说明问题出在哪里,您也没有显示实
@OneToMany
在persistence.xml
包含以下内容时不起作用(返回null):
(拖放并创建)
注意:@OneToMany
可以正确使用Hibernate
有人能解决这个问题吗?你能描述一下你所说的“工作正常”和“不工作”是什么意思吗?没有任何信息可以说明问题出在哪里,您也没有显示实体,甚至没有提到问题是否出在创建的表上。您能描述一下您所说的“工作正常”和“不工作”吗?没有任何信息可以说明问题出在哪里,您也没有显示实体,甚至没有提到问题是否出在创建的表上。您能描述一下您所说的“工作正常”和“不工作”吗?没有任何信息可以说明问题出在哪里,您也没有显示实体,甚至没有提到问题是否出在创建的表上。
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
<property name="javax.persistence.schema-generation.database.action" value="none"/>
<?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="XXXX-ejbPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/xxxxDatasource</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<shared-cache-mode>ALL</shared-cache-mode>
<properties>
<property name="javax.persistence.schema-generation.database.action" value="drop-and-create"/>
<property name="eclipselink.target-database" value="MySQL"/>
<property name="eclipselink.logging.level.sql" value="OFF"/>
<property name="eclipselink.logging.parameters" value="true"/>
<property name="eclipselink.persistence-context.flush-mode" value="AUTO"/>
</properties>
</persistence-unit>
</persistence>