문제

In my Entity class I have a field annotated as follows:

@ManyToOne
@JoinColumn(name = "sport_id", nullable=false)
public Sport sport;

in SQL it generates

sport_id                  bigint,

but I expect it to be

sport_id                  bigint not null,

Is it a bug of Ebean?

도움이 되었습니까?

해결책

Have you tried setting the optional flag of @ManyToOne?

@ManyToOne(optional=false) 
@JoinColumn(name = "sport_id", nullable=false)
public Sport sport;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top