开发者

ManyToOne column in embeddable class

I have two entities who embed (@Embedded) the Adress embeddable. In the Adress class there is a property who points to an entity Location. In the Adress class I put @ManyToOne and @JoinColumn(...) annotations above it. Now I get this error:

Exception Description: The table [persons] is not present in this descriptor. Descriptor: RelationalDescriptor(com.wordpress.aiids.voeder.model.Location --> [DatabaseTable(locations)])

It's the @JoinColumn annotation that causes the trouble:

@ManyToOne
//@JoinColumn(name = "gemeente", referencedColumnName = "gemeente", nullable = false)
private Gemeente gemeente;

Here's the full code of the embbedable class.

http:/开发者_Python百科/aiids.pastebin.com/G1sijNBL

Do I do something wrong by putting those annotations there or what's the cause of this error?

SOLUTION!

The solution is that the referencedColumnName must point to the Primary Key of the Entity Gemeente which was "postcode" and not "gemeente".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜