https://forums.manning.com/posts/list/190.page
JForum - http://www.jforum.netImmutable Primary Key? on page 51ff of the most recent MEAP edition you mention that primary keys must be immutable. That statement qualifies at best as your personal opinion, but it is not true as a general rule. The SQL standard does not impose such a requirement, neither does any of the RDBMS that I know of.

SQL even provides a "ON UPDATE CASCADE" clause to cater for primary keys that are pointed to by foreign keys, which again goes against the statement from page 52 "Changing the value (or even definition) of a primary key, and all foreign keys that refer to it, is a frustrating task". Frustrating for who?

regards,
Christian Sell]]>https://forums.manning.com/posts/preList/31674/92897.pagehttps://forums.manning.com/posts/preList/31674/92897.page
GMTRe: Immutable Primary Key?https://forums.manning.com/posts/preList/31674/92895.pagehttps://forums.manning.com/posts/preList/31674/92895.page
GMTRe: Immutable Primary Key? That would also imply that a legacy schema that relies on mutable keys cannot be mapped with Hibernate/JPA]]>https://forums.manning.com/posts/preList/31674/92898.pagehttps://forums.manning.com/posts/preList/31674/92898.page
GMTRe: Immutable Primary Key? The relational model defines that a candidate key must be unique and irreducible (no subset of
the key attributes has the uniqueness property). There are no nulls in the relational model, so
this requirement is related to SQL. Picking a candidate key as <em>the</em> primary key is
actually a matter of taste. However, Hibernate expects that a candidate key is also immutable
when it's used as the primary key. Hibernate doesn't support updating primary key values with an
API, and you'd run into problems with Hibernate's caching and dirty checking engine if you try
to work around this requirement. If your existing database schema relies on updatable primary
keys (and maybe uses <code>ON UPDATE CASCADE</code> foreign key constraints), you must
change the schema before it will work with Hibernate.]]>https://forums.manning.com/posts/preList/31674/92896.pagehttps://forums.manning.com/posts/preList/31674/92896.page
GMTRe: Immutable Primary Key?https://forums.manning.com/posts/preList/31674/92899.pagehttps://forums.manning.com/posts/preList/31674/92899.page
GMT