有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java JPA继承表每类SQLSyntaxErrorException

每次启动应用程序时,我都会收到一个SQLSyntaxErrorException。 我没有任何jpa继承的经验 也不知道这些表是在哪里创建的。 是否有人对此了解更多,并愿意提供帮助

例外情况

[EL Warning]: 2017-09-17 18:16:13.471--ServerSession(2032898330)--Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLSyntaxErrorException: Syntax error: Encountered ")" at line 1, column 20.
Error Code: 30000
Call: CREATE TABLE ITEM ()
Query: DataModifyQuery(sql="CREATE TABLE ITEM ()")

持久性。xml

<?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="Boredom2.0PU" transaction-type="RESOURCE_LOCAL">
    <provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
    <class>domain.item.Book</class>
    <class>domain.item.Movie</class>
    <class>domain.item.TvShow</class>
    <class>domain.item.Franchise</class>
    <class>domain.item.Comicbook</class>
    <class>domain.item.VideoGame</class>
    <class>domain.item.Manga</class>
    <class>domain.item.Genre</class>
    <class>domain.item.Item</class>
    <properties>
      <property name="javax.persistence.jdbc.url" value="jdbc:derby://localhost:1527/BoredomDB"/>
      <property name="javax.persistence.jdbc.user" value="root"/>
      <property name="javax.persistence.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"/>
      <property name="javax.persistence.jdbc.password" value="root"/>
      <property name="javax.persistence.schema-generation.database.action" value="create"/>
    </properties>
  </persistence-unit>
</persistence>

项目

@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class Item extends IEntity implements Serializable{

Entity

@MappedSuperclass
public abstract class IEntity {

共 (0) 个答案