Templates can';t访问@OneToOne映射实体

Templates can';t访问@OneToOne映射实体,templates,scala,playframework-2.0,ebean,Templates,Scala,Playframework 2.0,Ebean,我的数据模型: public class Tour extends Model { @Id public Integer id; @ManyToOne public Sport sport; @OneToOne(mappedBy="genericTour") FootballTour footballTour; @OneToOne(mappedBy="genericTour") TennisTour tennisTou

我的数据模型:

public class Tour extends Model {    
    @Id
    public Integer id;

    @ManyToOne
    public Sport sport;

    @OneToOne(mappedBy="genericTour")
    FootballTour footballTour;

    @OneToOne(mappedBy="genericTour")
    TennisTour tennisTour;

    public static Finder<Integer, Tour> find(){
        return new Finder<Integer,Tour>(Integer.class,Tour.class);
    }
}

public class FootballTour extends Model {

    @Id
    public Integer id;

    @OneToOne
    Tour genericTour;

    public static Finder<Integer, FootballTour> find(){
        return new Finder<Integer,FootballTour>(Integer.class,FootballTour.class);
    }

}
公共类教程扩展模型{
@身份证
公共整数id;
@许多酮
公共体育;
@OneTONE(mappedBy=“genericTour”)
足球巡回赛足球巡回赛;
@OneTONE(mappedBy=“genericTour”)
坦尼斯托尔;
公共静态查找器find(){
返回新的查找器(Integer.class、Tour.class);
}
}
公营足球巡回赛扩展模式{
@身份证
公共整数id;
@奥内托内
旅游总公司;
公共静态查找器find(){
返回新的查找器(Integer.class、FootballTour.class);
}
}
我的行动(只是为了表明我正在进行“足球巡回赛”):

公共静态结果getToursBySportTag(字符串sportTag){
Query Query=Tour.find().fetch(“运动”).fetch(“足球之旅”);
List finedTours=query.where().eq(“tag”,sportTag).findList();
返回ok(tours.render(finedTours));
}
在scala模板中,我想访问Tour的footballTour字段:

@(tours: List[Tour])
@main("Football tours") {
<h1>Football tours List</h1>
<dl>
@for(tour <- tours) {
<dt>
<a href="@routes.Application.tour(tour.id)">
@tour.footballTour.id
</a>
</dt>
}
</dl>
}
@(巡演:列表[巡演])
@主要(“足球之旅”){
足球巡回赛名单

@对于(tour而言,
足球巡回赛
课程的
常规字段我们的
应该是公共的:

public class FootballTour extends Model {

    @Id
    public Integer id;

    @OneToOne
    public Tour genericTour;  // <<<<< Here !!

    public static Finder<Integer, FootballTour> find(){
        return new Finder<Integer,FootballTour>(Integer.class,FootballTour.class);
    }

}
public class FootballTour扩展了模型{
@身份证
公共整数id;
@奥内托内

public Tour genericTour;//足球巡回赛
课程的
genericTour
字段应为public:

public class FootballTour extends Model {

    @Id
    public Integer id;

    @OneToOne
    public Tour genericTour;  // <<<<< Here !!

    public static Finder<Integer, FootballTour> find(){
        return new Finder<Integer,FootballTour>(Integer.class,FootballTour.class);
    }

}
public class FootballTour扩展了模型{
@身份证
公共整数id;
@奥内托内

public Tour genericTour;//该字段也可以标记为受保护。该字段也可以标记为受保护。