1
我试图在二维集合中存储数据表。 每当我:在Play中创建一个二维数组!框架
@OneToMany
public List<List<Cell>> cells;
我得到一个错误JPA:
JPA错误 发生JPA错误(无法建立的EntityManagerFactory):@OneToMany或@ManyToMany针对未映射类的使用:models.Table .cells [java.util.List]
Cell是我创建的一个类,它基本上是一个String装饰器。有任何想法吗?我只需要一个可以存储的二维矩阵。
@Entity public class Table extends Model {
@OneToMany
public List<Row> rows;
public Table() {
this.rows = new ArrayList<Row>();
this.save();
}
}
@Entity public class Row extends Model {
@OneToMany
public List<Cell> cells;
public Row() {
this.cells = new ArrayList<Cell>();
this.save();
}
}
@Entity public class Cell extends Model {
public String content;
public Cell(String content) {
this.content = content;
this.save();
}
}
我想什么你说的和我越来越:发生 JPA错误 一个JPA错误(无法建立的EntityManagerFactory):无法实例测试objectmodels.Row – zmahir
@zmahir你可以发布你使用的代码吗? –
最初的帖子是用代码编辑的。 – zmahir