我刚开始使用Play Framework.完成教程(涵盖基本功能)后,我尝试在数据库和播放之间建立连接.我的一个关系有架构:
CREATE TABLE IF NOT EXISTS `shop`.`CatPath` (
`parentC` INT NOT NULL ,
`childC` INT NOT NULL ,
`depth` INT NOT NULL ,
PRIMARY KEY (`parentC`, `childC`)
)
Run Code Online (Sandbox Code Playgroud)
所以我建立了模型的类:
@Entity
public class CatPath extends Model {
@EmbeddedId
public CatPathKey key;
public Long depth;
public class CatPathKey {
public Long parentC;
public Long childC;
}
public static Finder<CatPathKey, CatPath> find = new Finder<CatPathKey, CatPath>(CatPathKey.class, CatPath.class);
Run Code Online (Sandbox Code Playgroud)
编译后我得到异常:
PersistenceException: Could not find BeanDescriptor for class models.CatPath$KatPathKey. Perhaps the EmbeddedId class is not …Run Code Online (Sandbox Code Playgroud)