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