Repository: deltaspike
Updated Branches:
  refs/heads/master 2af2ccf25 -> 8fc6b38bb


DELTASPIKE-627 API clarifications.


Project: http://git-wip-us.apache.org/repos/asf/deltaspike/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltaspike/commit/8fc6b38b
Tree: http://git-wip-us.apache.org/repos/asf/deltaspike/tree/8fc6b38b
Diff: http://git-wip-us.apache.org/repos/asf/deltaspike/diff/8fc6b38b

Branch: refs/heads/master
Commit: 8fc6b38bbcca6314e71337c499b035a11be0b4a6
Parents: 11af2fa
Author: Thomas Hug <[email protected]>
Authored: Thu Jun 12 11:23:26 2014 -0700
Committer: Thomas Hug <[email protected]>
Committed: Thu Jun 12 11:23:42 2014 -0700

----------------------------------------------------------------------
 .../org/apache/deltaspike/data/api/EntityRepository.java     | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/deltaspike/blob/8fc6b38b/deltaspike/modules/data/api/src/main/java/org/apache/deltaspike/data/api/EntityRepository.java
----------------------------------------------------------------------
diff --git 
a/deltaspike/modules/data/api/src/main/java/org/apache/deltaspike/data/api/EntityRepository.java
 
b/deltaspike/modules/data/api/src/main/java/org/apache/deltaspike/data/api/EntityRepository.java
index cef4e01..b31b96e 100755
--- 
a/deltaspike/modules/data/api/src/main/java/org/apache/deltaspike/data/api/EntityRepository.java
+++ 
b/deltaspike/modules/data/api/src/main/java/org/apache/deltaspike/data/api/EntityRepository.java
@@ -24,7 +24,7 @@ import java.util.List;
 import javax.persistence.metamodel.SingularAttribute;
 
 /**
- * Base Repository interface. All methods are implemented by the query 
extension.
+ * Base Repository interface. All methods are implemented by the CDI extension.
  *
  * @param <E>   Entity type.
  * @param <PK>  Primary key type.
@@ -33,7 +33,11 @@ public interface EntityRepository<E, PK extends Serializable>
 {
 
     /**
-     * Persist (new entity) or merge the given entity.
+     * Persist (new entity) or merge the given entity. The distinction on 
calling either
+     * method is done based on the primary key field being null or not.
+     * If this results in wrong behavior for a specific case, consider using 
the
+     * {@link org.apache.deltaspike.data.api.EntityManagerDelegate} which 
offers both
+     * {@code persist} and {@code merge}.
      * @param entity            Entity to save.
      * @return                  Returns the modified entity.
      */

Reply via email to