zoukankan      html  css  js  c++  java
  • JPA--Caused by: javax.persistence.PersistenceException: [PersistenceUnit: mysqlJPA] Unable to configure EntityManagerFactory

    出现此错误的原因是因为在Supplier类的id上添加了@GeneratedValue(strategy = GenerationType.AUTO, generator = "sequenceGenerator"),

    而sequenceGenerator不存在。

    package pr.cgl.model;

    import javax.annotation.Generated;
    import javax.persistence.*;
    import java.util.ArrayList;
    import java.util.List;

    /**
    * Created by xiaotuerguaiguai on 15/11/30.
    */
    @Entity
    @Table(name = "xx_supplier")
    public class Supplier {

    private Integer id;

    private String name;

    private List<Product> productList = new ArrayList<Product>();

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "sequenceGenerator")
    public Integer getId() {
    return id;
    }

    public void setId(Integer id) {
    this.id = id;
    }

    public String getName() {
    return name;
    }

    public void setName(String name) {
    this.name = name;
    }

    @Transient
    public List<Product> getProductList() {
    return productList;
    }

    public void setProductList(List<Product> productList) {
    this.productList = productList;
    }
    }
  • 相关阅读:
    XRTable 表新增列和行数据
    sql server 清理数据库日志
    C# 数字 转换 大写汉字
    NavBarControl 简单配置
    bandedGridView
    TileView 基本配置
    CardView 基本配置
    ButtonEdit 参数配置
    无边框窗体,鼠标移动窗体
    【网站】windows phpstudy v8.1搭建https
  • 原文地址:https://www.cnblogs.com/cglWorkBook/p/5046883.html
Copyright © 2011-2022 走看看