[Lada-commits] [PATCH 1 of 4] Documentation
Wald Commits
scm-commit at wald.intevation.org
Wed Jul 8 09:42:30 CEST 2015
# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1436262996 -7200
# Node ID 46bb231ff9b9e0256520287a1fe00bd0be24d196
# Parent 6441bb4a90f0132ed92a216bf3a3a43a791ad138
Documentation.
diff -r 6441bb4a90f0 -r 46bb231ff9b9 src/main/java/de/intevation/lada/factory/ProbeFactory.java
--- a/src/main/java/de/intevation/lada/factory/ProbeFactory.java Wed Jul 01 15:28:57 2015 +0200
+++ b/src/main/java/de/intevation/lada/factory/ProbeFactory.java Tue Jul 07 11:56:36 2015 +0200
@@ -1,3 +1,10 @@
+/* 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.factory;
import java.math.BigInteger;
@@ -25,12 +32,30 @@
import de.intevation.lada.util.data.RepositoryType;
import de.intevation.lada.util.rest.Response;
+/**
+ * This factory creates probe objects and its children using a messprogramm
+ * as template.
+ *
+ * @author <a href="mailto:rrenkert at intevation.de">Raimund Renkert</a>
+ */
public class ProbeFactory {
+ /**
+ * The data repository
+ */
@Inject
@RepositoryConfig(type = RepositoryType.RW)
private Repository repository;
+ /**
+ * Create a list of probe objects
+ *
+ * @param id Messprogramm id
+ * @param from The start date
+ * @param to The end date
+ *
+ * @return List of probe objects.
+ */
public List<LProbe> create(String id, Long from, Long to) {
QueryBuilder<Messprogramm> builder =
new QueryBuilder<Messprogramm>(
@@ -49,13 +74,9 @@
start.setTime(new Date(from));
Calendar end = Calendar.getInstance();
end.setTime(new Date (to));
- // benutzereingabe + gültigVon/Bis
- // kann mehrere Intervalle enthalten, wenn nutzereingabe über mehrere
- // Jahre.
Date[][] intervals = calculateIntervals(start, end, messprogramm);
List<LProbe> proben = new ArrayList<LProbe>();
for (Date[] interval : intervals) {
- //erzeuge proben für einen intervall(gültigkeitsbereich)
createProben(interval, messprogramm, proben);
}
return proben;
diff -r 6441bb4a90f0 -r 46bb231ff9b9 src/main/resources/META-INF/persistence.xml
--- a/src/main/resources/META-INF/persistence.xml Wed Jul 01 15:28:57 2015 +0200
+++ b/src/main/resources/META-INF/persistence.xml Tue Jul 07 11:56:36 2015 +0200
@@ -2,34 +2,45 @@
<persistence version="2.1"
xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
+ <!-- PU for bund datasource. Maps to the schema 'bund' in the Lada database. -->
<persistence-unit name="bund">
+ <!-- The JTA datasource configured in the Wildfly AS -->
<jta-data-source>java:/jboss/lada-bund</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
+ <!-- The JNDI name for lookups in the application -->
<property name="jboss.entity.manager.jndi.name" value="java:app/entitymanager/bund"/>
<!-- Properties for Hibernate -->
+ <property name="hibernate.hbm2ddl.auto" value="none"/>
<property name="hibernate.show_sql" value="false" />
+ <!-- Use a special PostGIS dialect implmented for Lada. This dialect implements an additional integer array type -->
<property name="hibernate.dialect" value="de.intevation.lada.util.data.LadaPostgisDialect"/>
- <property name="hibernate.hbm2ddl.auto" value="none"/>
</properties>
</persistence-unit>
<persistence-unit name="land">
+ <!-- The JTA datasource configured in the Wildfly AS -->
<jta-data-source>java:/jboss/lada-land</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<properties>
+ <!-- The JNDI name for lookups in the application -->
<property name="jboss.entity.manager.jndi.name" value="java:app/entitymanager/land"/>
+ <!-- Properties for Hibernate -->
+ <property name="hibernate.hbm2ddl.auto" value="none"/>
<property name="hibernate.show_sql" value="true" />
+ <!-- Use a special PostGIS dialect implmented for Lada. This dialect implements an additional integer array type -->
<property name="hibernate.dialect" value="de.intevation.lada.util.data.LadaPostgisDialect"/>
- <property name="hibernate.hbm2ddl.auto" value="none"/>
</properties>
</persistence-unit>
<persistence-unit name="stamm">
+ <!-- The JTA datasource configured in the Wildfly AS -->
<jta-data-source>java:/jboss/lada-stamm</jta-data-source>
<properties>
+ <!-- The JNDI name for lookups in the application -->
<property name="jboss.entity.manager.jndi.name" value="java:app/entitymanager/stamm"/>
- <property name="hibernate.dialect" value="org.hibernate.spatial.dialect.postgis.PostgisDialect"/>
+ <!-- Properties for Hibernate -->
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.hbm2ddl.auto" value="none"/>
+ <property name="hibernate.dialect" value="org.hibernate.spatial.dialect.postgis.PostgisDialect"/>
</properties>
</persistence-unit>
</persistence>
More information about the Lada-commits
mailing list