我试图在 Telosys 中使用 dsl 模型生成 JPA 实体。
我的DSL模型:
Car {
id : int { @Id, @AutoIncremented };
user : Employee;
}
Employee {
id : long { @Id } ;
name : string ;
cars : Car[] ;
}
我使用这段代码:
$jpa.linkAnnotations(4, $link, $entity.nonKeyAttributes)
private ${link.fieldType} $link.fieldName ;
#end
我总是有这样的结果:
@OneToMany(mappedBy="null", targetEntity=Car.class)
private List<Car> cars ;
@ManyToOne
private Employee user ;
我的问题是,我总是得到 mappedBy="null",我该如何解决这个问题?