From 877c626fa452d0f85fad880d47a92504fd49a95c Mon Sep 17 00:00:00 2001 From: Gustavo Date: Fri, 24 Aug 2012 15:47:48 -0300 Subject: [PATCH] applying javadoc to delegatecrud class --- impl/core/src/main/java/br/gov/frameworkdemoiselle/template/DelegateCrud.java | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/impl/core/src/main/java/br/gov/frameworkdemoiselle/template/DelegateCrud.java b/impl/core/src/main/java/br/gov/frameworkdemoiselle/template/DelegateCrud.java index ba9e63c..25fcdd3 100644 --- a/impl/core/src/main/java/br/gov/frameworkdemoiselle/template/DelegateCrud.java +++ b/impl/core/src/main/java/br/gov/frameworkdemoiselle/template/DelegateCrud.java @@ -51,12 +51,24 @@ public class DelegateCrud> implements Crud { private C delegate; + /** + * Remove a persistent instance from the database. + * + * @param id + * entity class with the given identifier + */ @Override @Transactional public void delete(final I id) { this.getDelegate().delete(id); } + /** + * Remove a list of persistent instances from the database. + * + * @param idList + * list of entity class with the given identifier + */ @Transactional public void delete(final List idList) { ListIterator iter = idList.listIterator(); @@ -65,6 +77,11 @@ public class DelegateCrud> implements Crud { } } + /** + * Get the results. + * + * @return the list of matched query results. + */ @Override public List findAll() { return getDelegate().findAll(); @@ -79,26 +96,46 @@ public class DelegateCrud> implements Crud { protected Class getDelegateClass() { if (this.delegateClass == null) { - this.delegateClass = Reflections.getGenericTypeArgument(this.getClass(), 2); + this.delegateClass = Reflections.getGenericTypeArgument( + this.getClass(), 2); } return this.delegateClass; } + /** + * Persist the given transient instance. + * + * @param bean + * a transient instance of a persistent class + */ @Override @Transactional public void insert(final T bean) { getDelegate().insert(bean); } + /** + * Return the persistent instance of the given entity class with the given + * identifier + * + * @return the persistent instance + */ @Override public T load(final I id) { return getDelegate().load(id); } + /** + * + * Update the persistent instance with the identifier of the given detached + * instance. + * + * @param bean + * a detached instance containing updated state. + */ @Override @Transactional public void update(final T bean) { getDelegate().update(bean); } - } -- libgit2 0.21.2