com.force.sdk.jpa
Class BaseEntity

java.lang.Object
  extended by com.force.sdk.jpa.BaseEntity

public final class BaseEntity
extends Object

Utility for allowing merges on transient objects, i.e. objects that have not necessarily been persisted or retrieved via the EntityManager

Author:
Fiaz Hossain

Method Summary
static
<T> T
initialiseForTransientMerge(javax.persistence.EntityManager em, T obj)
          Initialise an object of type T to be available for a merge() call even if it has not been persisted or retrieved, by injecting a custom state manager into the object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

initialiseForTransientMerge

public static <T> T initialiseForTransientMerge(javax.persistence.EntityManager em,
                                                T obj)
Initialise an object of type T to be available for a merge() call even if it has not been persisted or retrieved, by injecting a custom state manager into the object.

Type Parameters:
T - the type of a PersistenceCapable entity
Parameters:
em - the entity manager used for persisting
obj - the object being persisted
Returns:
the object that is now ready for a transient merge


Copyright © 2011. All Rights Reserved.