首页 > 数据库技术 > 详细

JPA--Caused by: javax.persistence.PersistenceException: [PersistenceUnit: mysqlJPA] Unable to configure EntityManagerFactory

时间:2015-12-15 00:43:31      阅读:1420      评论:0      收藏:0      [点我收藏+]

出现此错误的原因是因为在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;
}
}

JPA--Caused by: javax.persistence.PersistenceException: [PersistenceUnit: mysqlJPA] Unable to configure EntityManagerFactory

原文:http://www.cnblogs.com/cglWorkBook/p/5046883.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!