Mercurial > lada > lada-server
diff src/main/java/de/intevation/lada/data/ReadOnlyRepository.java @ 220:f0482fa04e2b
Code documentation and minor code style.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Thu, 04 Jul 2013 13:45:40 +0200 |
parents | 8fdb699405aa |
children | 567ce7697fc7 |
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/data/ReadOnlyRepository.java Thu Jul 04 13:43:11 2013 +0200 +++ b/src/main/java/de/intevation/lada/data/ReadOnlyRepository.java Thu Jul 04 13:45:40 2013 +0200 @@ -12,6 +12,11 @@ import de.intevation.lada.rest.Response; +/** + * Repository that allows read only access to model objects. + * + * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a> + */ @ApplicationScoped @Named("readonlyrepository") public class ReadOnlyRepository implements Repository @@ -29,8 +34,8 @@ /** * Filter object list by the given criteria. * - * @param criteria - * @return List of objects. + * @param criteria The filter query. + * @return Response object. */ public <T> Response filter(CriteriaQuery<T> filter) { List<T> result = em.createQuery(filter).getResultList(); @@ -40,8 +45,8 @@ /** * Get all objects of type <link>clazz</link>from database. * - * @param clazz The class type. - * @return List of objects. + * @param clazz The object type. + * @return Response object. */ public <T> Response findAll(Class<T> clazz) { CriteriaBuilder builder = em.getCriteriaBuilder(); @@ -55,9 +60,9 @@ /** * Find a single object identified by its id. * - * @param clazz The class type. - * @param id The object id. - * @return The requested object of type clazz + * @param clazz The object type. + * @param id The object id. + * @return Response object. */ public <T> Response findById(Class<T> clazz, String id) { T item = em.find(clazz, id); @@ -67,15 +72,30 @@ return new Response(true, 200, item); } + /** + * This class does not support this operation. + * + * @param object + */ public Response create(Object object) { return null; } + /** + * This class does not support this operation. + * + * @param object + */ public Response update(Object object) { return null; } + /** + * This class does not support this operation. + * + * @param object + */ public Response delete(Object object) { return null; } -} +} \ No newline at end of file