我已经用我的模型完成了一些删除,但是一个使用了错误的列名
GroupeCours gc = GroupeCours.find
.where()
.eq("id",id)
.findUnique();
GroupeCours gc2 = new GroupeCours();
gc2.id=10L;
gc2.nom="testbidon";
EbeanServer server = Ebean.getServer("refens");
server.insert(gc2);
server.update(gc); //is ok
server.delete(gc); //fail
GC类
@SuppressWarnings("serial")
@Entity
@Table(name="GroupeCours", uniqueConstraints = {
@UniqueConstraint(columnNames = { "nom", "anneeVersion", "idComposante" }),
@UniqueConstraint(columnNames = { "id", "anneeVersion", "idComposante" }) })
public class GroupeCours extends AbstractModel {
/**
* Clé primaire
*/
@Id
@Column(name="id")
public Long id;
错误详情是
play.core.ActionInvoker$$anonfun$receive$1$$anon$1: Execution exception [[PersistenceException: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'GroupeCours_id' in 'where clause']]
为什么要寻找钥匙 GroupeCours_id?
注意:插入和更新运行良好