小编GLF*_*GLF的帖子

playframework JPA错误和数据库设计问题

我收到以下错误:

JPA错误发生JPA错误(无法构建EntityManagerFactory):模型上的@OneToOne或@ManyToOne.Issue.project引用未知实体:models.Project

在这里你可以看到我的实体:

package models;


import java.util.*;

import javax.persistence.*;
import play.db.jpa.*;
import models.Issue;
import models.Component;

public class Project extends Model{

public String self;
@Id
public String key;

@OneToMany (mappedBy="Project", cascade=CascadeType.ALL)
public List<Component> components;

@OneToMany (mappedBy="Project", cascade=CascadeType.ALL)
public List<Issue> issues;


public Project(String self, String key) {

    this.self = self;
    this.key = key;
    this.components = new ArrayList<Component>();
    this.issues = new ArrayList<Issue>();
}


public Project addComponent(String self, int component_id, String name, int issuecount) {

    Component newComponent = new Component(self, component_id, name, issuecount, this); …
Run Code Online (Sandbox Code Playgroud)

jpa playframework

2
推荐指数
1
解决办法
1081
查看次数

标签 统计

jpa ×1

playframework ×1