Commit 877c626fa452d0f85fad880d47a92504fd49a95c

Authored by Gustavo
1 parent 1537c49d
Exists in master

applying javadoc to delegatecrud class

impl/core/src/main/java/br/gov/frameworkdemoiselle/template/DelegateCrud.java
@@ -51,12 +51,24 @@ public class DelegateCrud<T, I, C extends Crud<T, I>> implements Crud<T, I> { @@ -51,12 +51,24 @@ public class DelegateCrud<T, I, C extends Crud<T, I>> implements Crud<T, I> {
51 51
52 private C delegate; 52 private C delegate;
53 53
  54 + /**
  55 + * Remove a persistent instance from the database.
  56 + *
  57 + * @param id
  58 + * entity class with the given identifier
  59 + */
54 @Override 60 @Override
55 @Transactional 61 @Transactional
56 public void delete(final I id) { 62 public void delete(final I id) {
57 this.getDelegate().delete(id); 63 this.getDelegate().delete(id);
58 } 64 }
59 65
  66 + /**
  67 + * Remove a list of persistent instances from the database.
  68 + *
  69 + * @param idList
  70 + * list of entity class with the given identifier
  71 + */
60 @Transactional 72 @Transactional
61 public void delete(final List<I> idList) { 73 public void delete(final List<I> idList) {
62 ListIterator<I> iter = idList.listIterator(); 74 ListIterator<I> iter = idList.listIterator();
@@ -65,6 +77,11 @@ public class DelegateCrud&lt;T, I, C extends Crud&lt;T, I&gt;&gt; implements Crud&lt;T, I&gt; { @@ -65,6 +77,11 @@ public class DelegateCrud&lt;T, I, C extends Crud&lt;T, I&gt;&gt; implements Crud&lt;T, I&gt; {
65 } 77 }
66 } 78 }
67 79
  80 + /**
  81 + * Get the results.
  82 + *
  83 + * @return the list of matched query results.
  84 + */
68 @Override 85 @Override
69 public List<T> findAll() { 86 public List<T> findAll() {
70 return getDelegate().findAll(); 87 return getDelegate().findAll();
@@ -79,26 +96,46 @@ public class DelegateCrud&lt;T, I, C extends Crud&lt;T, I&gt;&gt; implements Crud&lt;T, I&gt; { @@ -79,26 +96,46 @@ public class DelegateCrud&lt;T, I, C extends Crud&lt;T, I&gt;&gt; implements Crud&lt;T, I&gt; {
79 96
80 protected Class<C> getDelegateClass() { 97 protected Class<C> getDelegateClass() {
81 if (this.delegateClass == null) { 98 if (this.delegateClass == null) {
82 - this.delegateClass = Reflections.getGenericTypeArgument(this.getClass(), 2); 99 + this.delegateClass = Reflections.getGenericTypeArgument(
  100 + this.getClass(), 2);
83 } 101 }
84 return this.delegateClass; 102 return this.delegateClass;
85 } 103 }
86 104
  105 + /**
  106 + * Persist the given transient instance.
  107 + *
  108 + * @param bean
  109 + * a transient instance of a persistent class
  110 + */
87 @Override 111 @Override
88 @Transactional 112 @Transactional
89 public void insert(final T bean) { 113 public void insert(final T bean) {
90 getDelegate().insert(bean); 114 getDelegate().insert(bean);
91 } 115 }
92 116
  117 + /**
  118 + * Return the persistent instance of the given entity class with the given
  119 + * identifier
  120 + *
  121 + * @return the persistent instance
  122 + */
93 @Override 123 @Override
94 public T load(final I id) { 124 public T load(final I id) {
95 return getDelegate().load(id); 125 return getDelegate().load(id);
96 } 126 }
97 127
  128 + /**
  129 + *
  130 + * Update the persistent instance with the identifier of the given detached
  131 + * instance.
  132 + *
  133 + * @param bean
  134 + * a detached instance containing updated state.
  135 + */
98 @Override 136 @Override
99 @Transactional 137 @Transactional
100 public void update(final T bean) { 138 public void update(final T bean) {
101 getDelegate().update(bean); 139 getDelegate().update(bean);
102 } 140 }
103 -  
104 } 141 }