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