Quantcast
Channel: JPA Embeddeble PK and nullable field - Stack Overflow
Viewing all articles
Browse latest Browse all 5

Answer by Karibasappa G C for JPA Embeddeble PK and nullable field

$
0
0

JPA guideline or "common sense" not allowed to use nullable fields for EmbeddebedId? If not, what annotions or logic do i need to add to make it work without adding another PK?

answer is as below

@EmbeddedIdprivate AttributePK attrPK;

does not allow the primary key to be null.

so to make it happen use another annotation like below

@IdClass(AttributePK.class) private AttributePK attrPK;

Viewing all articles
Browse latest Browse all 5

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>