git://wamblee.org
/
utils
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Git ignore file added.
[utils]
/
support
/
general
/
src
/
main
/
java
/
org
/
wamblee
/
persistence
/
JpaDetachable.java
diff --git
a/support/general/src/main/java/org/wamblee/persistence/JpaDetachable.java
b/support/general/src/main/java/org/wamblee/persistence/JpaDetachable.java
index ac0912f82b2d4ead6bc51cf8f0631aa8bde38d79..04d60e8489a7b89c05f310e2d038a9e25eda1381 100644
(file)
--- a/
support/general/src/main/java/org/wamblee/persistence/JpaDetachable.java
+++ b/
support/general/src/main/java/org/wamblee/persistence/JpaDetachable.java
@@
-20,36
+20,41
@@
import java.io.Serializable;
import javax.persistence.EntityManager;
/**
import javax.persistence.EntityManager;
/**
- * Detachable JPA entity.
+ * Detachable JPA entity.
*
* @author Erik Brakkee
*
* @author Erik Brakkee
- *
- * @param <T> Entity type.
+ *
+ * @param <T>
+ * Entity type.
*/
public class JpaDetachable<T> extends AbstractDetachable<T, Serializable> {
*/
public class JpaDetachable<T> extends AbstractDetachable<T, Serializable> {
-
- private EntityManager entityManager;
- private Class<T> entityType;
-
+
+ private EntityManager entityManager;
+ private Class<T> entityType;
+
/**
/**
- * Constructs the detachable.
- * @param aEntity Entity.
+ * Constructs the detachable.
+ *
+ * @param aEntity
+ * Entity.
*/
public JpaDetachable(EntityManager aEntityManager, T aEntity) {
super(aEntity);
entityManager = aEntityManager;
*/
public JpaDetachable(EntityManager aEntityManager, T aEntity) {
super(aEntity);
entityManager = aEntityManager;
- entityType = (Class<T>)aEntity.getClass();
+ entityType = (Class<T>)
aEntity.getClass();
}
}
-
+
/*
* (non-Javadoc)
/*
* (non-Javadoc)
- * @see org.wamblee.persistence.AbstractDetachable#getReference(java.lang.Object)
+ *
+ * @see
+ * org.wamblee.persistence.AbstractDetachable#getReference(java.lang.Object)
*/
protected Serializable getReference(T aObject) {
Persistent persistent = PersistentFactory.create(aObject);
*/
protected Serializable getReference(T aObject) {
Persistent persistent = PersistentFactory.create(aObject);
- return persistent.getPrimaryKey();
+ return persistent.getPrimaryKey();
}
}
-
+
@Override
protected T load(Serializable aReference) {
return entityManager.find(entityType, aReference);
@Override
protected T load(Serializable aReference) {
return entityManager.find(entityType, aReference);