[jboss-jira] [JBoss JIRA] (WFLY-2744) JPA .schema-generation-action compliance issue
Leos Literak (JIRA)
issues at jboss.org
Sat Jan 11 15:25:33 EST 2014
Leos Literak created WFLY-2744:
----------------------------------
Summary: JPA .schema-generation-action compliance issue
Key: WFLY-2744
URL: https://issues.jboss.org/browse/WFLY-2744
Project: WildFly
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: JPA / Hibernate
Affects Versions: 8.0.0.CR1
Environment: windows
Reporter: Leos Literak
Assignee: Scott Marlow
I had following persistence.xml in my war application:
<?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="OAUTHDEMO" transaction-type="JTA">
<jta-data-source>java:jboss/datasources/test</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
<property name="javax.persistence.schema-generation.database.action" value="create"/>
</properties>
</persistence-unit>
</persistence>
When I ran it second time, deployment failed because table already existed. I downloaded JPA specification to read how it is defined and there is such statement:
javax.persistence.schema-generation-action
The javax.persistence.schema-generation-action property specifies the
action to be taken by the persistence provider. If the javax.persistence.
schema-generation-target property is not specified, no action must be
taken, regardless of the value of the javax.persistence.schema-generation-
action property. The values for this property are "none", "create",
"drop-and-create", "drop".
Following sentence is interesting, because I do not have the schema-generation-target property defined:
If the javax.persistence.
schema-generation-target property is not specified, no action must be
taken, regardless of the value of the javax.persistence.schema-generation-action property.
So unless I misunderstood this line, then JPA implementation is incorrect.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list