我正在尝试使用我自己的 springboot 模板和 Dsl 模型生成类。在我的“.entity”文件中,我有:
Car {
id : int { @Id, @AutoIncremented };
users : Employee [];
}
Employee {
id : long { @Id } ;
name : string ;
cars : Car[] ;
}
我在 JPA 中期待 @ManyToMany 关系,但我没有。与此相同:
Car {
id : int { @Id, @AutoIncremented };
user : Employee;
}
Employee {
id : long { @Id } ;
name : string ;
car : Car;
}
我期待@OneToOne 关系,但我不明白。看来我只能得到@ManyToOne 和@OneToMany。如何使用 DSL 模型获得 @ManyToMany 和 @OneToOne 关系?