Commit f8b9aeb1d842b22c15824e3796182ca354c7a064
Exists in
master
Atualizando o Javadoc do DelegateCrud com base no PUll Request submetido
no ramo master
Showing
1 changed file
with
34 additions
and
0 deletions
Show diff stats
impl/core/src/main/java/br/gov/frameworkdemoiselle/template/DelegateCrud.java
... | ... | @@ -53,6 +53,12 @@ public class DelegateCrud<T, I, C extends Crud<T, I>> implements Crud<T, I> { |
53 | 53 | |
54 | 54 | private transient C delegate; |
55 | 55 | |
56 | + /** | |
57 | + * Removes a instance from delegate. | |
58 | + * | |
59 | + * @param id | |
60 | + * Entity with the given identifier | |
61 | + */ | |
56 | 62 | @Override |
57 | 63 | public void delete(final I id) { |
58 | 64 | if (isRunningTransactionalOperations()) { |
... | ... | @@ -71,6 +77,12 @@ public class DelegateCrud<T, I, C extends Crud<T, I>> implements Crud<T, I> { |
71 | 77 | getDelegate().delete(id); |
72 | 78 | } |
73 | 79 | |
80 | + /** | |
81 | + * Removes a list of instances from delegate. | |
82 | + * | |
83 | + * @param ids | |
84 | + * List of entities identifiers | |
85 | + */ | |
74 | 86 | public void delete(final List<I> ids) { |
75 | 87 | if (isRunningTransactionalOperations()) { |
76 | 88 | transactionalDelete(ids); |
... | ... | @@ -91,6 +103,11 @@ public class DelegateCrud<T, I, C extends Crud<T, I>> implements Crud<T, I> { |
91 | 103 | } |
92 | 104 | } |
93 | 105 | |
106 | + /** | |
107 | + * Gets the results from delegate. | |
108 | + * | |
109 | + * @return The list of matched query results. | |
110 | + */ | |
94 | 111 | @Override |
95 | 112 | public List<T> findAll() { |
96 | 113 | return getDelegate().findAll(); |
... | ... | @@ -112,6 +129,12 @@ public class DelegateCrud<T, I, C extends Crud<T, I>> implements Crud<T, I> { |
112 | 129 | return this.delegateClass; |
113 | 130 | } |
114 | 131 | |
132 | + /** | |
133 | + * Delegates the insert operation of the given instance. | |
134 | + * | |
135 | + * @param bean | |
136 | + * A entity to be inserted by the delegate | |
137 | + */ | |
115 | 138 | @Override |
116 | 139 | public void insert(final T bean) { |
117 | 140 | if (isRunningTransactionalOperations()) { |
... | ... | @@ -130,11 +153,22 @@ public class DelegateCrud<T, I, C extends Crud<T, I>> implements Crud<T, I> { |
130 | 153 | getDelegate().insert(bean); |
131 | 154 | } |
132 | 155 | |
156 | + /** | |
157 | + * Returns the instance of the given entity with the given identifier | |
158 | + * | |
159 | + * @return The instance | |
160 | + */ | |
133 | 161 | @Override |
134 | 162 | public T load(final I id) { |
135 | 163 | return getDelegate().load(id); |
136 | 164 | } |
137 | 165 | |
166 | + /** | |
167 | + * Delegates the update operation of the given instance. | |
168 | + * | |
169 | + * @param bean | |
170 | + * The instance containing the updated state. | |
171 | + */ | |
138 | 172 | @Override |
139 | 173 | public void update(final T bean) { |
140 | 174 | if (isRunningTransactionalOperations()) { | ... | ... |