Java – JPA: @ primarykeyjoincolumn (…) and @ joincolumn (…, insertable =?, updatable =?) Same?

It can be derived from the JPA specification if there is no @ primarykeyjoincolumn (...) with pluggable and updatable parameters

@JoinColumn(...,insertable = false,updatable = false)

or

@JoinColumn(…,insertable = true,updatable = true)

For general (non inherited) associations? Should I swap? What are pluggable and updatable properties set to? Did they set anything? Note that I only navigate to (seemingly) implemented read-only properties

I'm using eclipse link and hibernate to get very inconsistent mapping exceptions

This is @ primarykeyjoincolumn JavaEE 5 6 Javadoc:

PrimaryKeyJoinColumn (JavaEE 5) PrimaryKeyJoinColumn (JavaEE 6)

quote:

Solution

Yes, they are equivalent

Note that in JPA 2.0, you can also add @ ID to the @ onetoone map and avoid duplicate base ID attributes that are exactly the same

notice

>Identity and sequencing > primary keys through onetoone and manytoone relationships and > onetoone > target foreign keys, primary key join columns, cascade primary keys

From the Wikibooks Java persistence page

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>