Mercurial > lada > lada-server
view src/main/java/de/intevation/lada/util/data/Repository.java @ 1282:9473a701cfdb
Added model and service for stammdaten.kta.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Fri, 03 Feb 2017 14:03:27 +0100 |
parents | d49ac8d5f3f7 |
children |
line wrap: on
line source
/* Copyright (C) 2013 by Bundesamt fuer Strahlenschutz * Software engineering by Intevation GmbH * * This file is Free Software under the GNU GPL (v>=3) * and comes with ABSOLUTELY NO WARRANTY! Check out * the documentation coming with IMIS-Labordaten-Application for details. */ package de.intevation.lada.util.data; import java.util.List; import javax.persistence.EntityManager; import javax.persistence.Query; import javax.persistence.criteria.CriteriaQuery; import de.intevation.lada.util.rest.Response; /** * This generic Container is an interface to request and select Data * objects from the connected database. * * @author <a href="mailto:rrenkert@intevation.de">Raimund Renkert</a> */ public interface Repository { public Response create(Object object, String dataSource); public Response update(Object object, String dataSource); public Response delete(Object object, String dataSource); public <T> Response filter(CriteriaQuery<T> filter, String dataSource); public <T> List<T> filterPlain(CriteriaQuery<T> filter, String dataSource); public <T> Response filter( CriteriaQuery<T> filter, int size, int start, String dataSource); public <T> List<T> filterPlain( CriteriaQuery<T> filter, int size, int start, String dataSource); public <T> Response getAll(Class<T> clazz, String dataSource); public <T> List<T> getAllPlain(Class<T> clazz, String dataSource); public <T> Response getById(Class<T> clazz, Object id, String dataSource); public <T> T getByIdPlain(Class<T> clazz, Object id, String dataSource); public Query queryFromString(String sql, String dataSource); public EntityManager entityManager(String dataSource); }