Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://www.jcp.org/en/jsr/detail?id=317" rel="noreferrer">JPA specification</a> contains a very precise description of semantics of these operations, better than in javadoc:</p> <blockquote> <p>The semantics of the <strong>persist</strong> operation, applied to an entity X are as follows: </p> <ul> <li><p>If X is a new entity, it becomes managed. The entity X will be entered into the database at or before transaction commit or as a result of the flush operation.</p></li> <li><p>If X is a preexisting managed entity, it is ignored by the persist operation. However, the persist operation is cascaded to entities referenced by X, if the relationships from X to these other entities are annotated with the <code>cascade=PERSIST</code> or <code>cascade=ALL</code> annotation element value or specified with the equivalent XML descriptor element.</p></li> <li><p>If X is a removed entity, it becomes managed.</p></li> <li><p>If X is a detached object, the <code>EntityExistsException</code> may be thrown when the persist operation is invoked, or the <code>EntityExistsException</code> or another <code>PersistenceException</code> may be thrown at flush or commit time.</p></li> <li><p>For all entities Y referenced by a relationship from X, if the relationship to Y has been annotated with the cascade element value <code>cascade=PERSIST</code> or <code>cascade=ALL</code>, the persist operation is applied to Y.</p></li> </ul> </blockquote> <hr> <blockquote> <p>The semantics of the <strong>merge</strong> operation applied to an entity X are as follows:</p> <ul> <li><p>If X is a detached entity, the state of X is copied onto a pre-existing managed entity instance X' of the same identity or a new managed copy X' of X is created.</p></li> <li><p>If X is a new entity instance, a new managed entity instance X' is created and the state of X is copied into the new managed entity instance X'.</p></li> <li><p>If X is a removed entity instance, an <code>IllegalArgumentException</code> will be thrown by the merge operation (or the transaction commit will fail).</p></li> <li><p>If X is a managed entity, it is ignored by the merge operation, however, the merge operation is cascaded to entities referenced by relationships from X if these relationships have been annotated with the cascade element value <code>cascade=MERGE</code> or <code>cascade=ALL</code> annotation.</p></li> <li><p>For all entities Y referenced by relationships from X having the cascade element value <code>cascade=MERGE</code> or <code>cascade=ALL</code>, Y is merged recursively as Y'. For all such Y referenced by X, X' is set to reference Y'. (Note that if X is managed then X is the same object as X'.)</p></li> <li><p>If X is an entity merged to X', with a reference to another entity Y, where <code>cascade=MERGE</code> or <code>cascade=ALL</code> is not specified, then navigation of the same association from X' yields a reference to a managed object Y' with the same persistent identity as Y.</p></li> </ul> </blockquote>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload