Class ObservationsRepository
- java.lang.Object
-
- de.narimo.georepo.server.api.observations.ObservationsRepository
-
public class ObservationsRepository extends Object
-
-
Constructor Summary
Constructors Constructor Description ObservationsRepository()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleancheckObservationsTableExists(int layerId)static voidcreateObservationsTable(int layerId)static List<Observation>getObservationsBySearchTerm(int layerId, String searchTerm)static List<Observation>getObservationsByTimeRange(int layerId, int gfid, String fromDate, String toDate)Group all observations for a gfid by distinct speciesId and academic name in the given time range and sum their occurrences.static List<Observation>getObservationsByYears(int layerId, int gfid)Group all observations for a gfid by distinct species id, academic name and available years and sum their occurrences.static voidinsertObservation(int layerId, Integer userId, Observation observation)
-
-
-
Method Detail
-
checkObservationsTableExists
public static boolean checkObservationsTableExists(int layerId) throws SQLException- Throws:
SQLException
-
getObservationsByTimeRange
public static List<Observation> getObservationsByTimeRange(int layerId, int gfid, String fromDate, String toDate) throws SQLException
Group all observations for a gfid by distinct speciesId and academic name in the given time range and sum their occurrences.- Parameters:
layerId-gfid-fromDate-toDate-- Returns:
- Throws:
SQLException
-
getObservationsByYears
public static List<Observation> getObservationsByYears(int layerId, int gfid) throws SQLException
Group all observations for a gfid by distinct species id, academic name and available years and sum their occurrences.- Parameters:
layerId-gfid-- Returns:
- Throws:
SQLException
-
getObservationsBySearchTerm
public static List<Observation> getObservationsBySearchTerm(int layerId, String searchTerm) throws SQLException
- Throws:
SQLException
-
insertObservation
public static void insertObservation(int layerId, Integer userId, Observation observation) throws SQLException- Throws:
SQLException
-
createObservationsTable
public static void createObservationsTable(int layerId) throws SQLException- Throws:
SQLException
-
-