[Schmitzm-commits] r1618 - in trunk/schmitzm-core/src/main: java/de/schmitzm java/de/schmitzm/sql resources/de/schmitzm/data/resource/locales
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Thu Jul 7 12:50:49 CEST 2011
Author: alfonx
Date: 2011-07-07 12:50:48 +0200 (Thu, 07 Jul 2011)
New Revision: 1618
Added:
trunk/schmitzm-core/src/main/java/de/schmitzm/sql/
trunk/schmitzm-core/src/main/java/de/schmitzm/sql/SqlUtil.java
Modified:
trunk/schmitzm-core/src/main/resources/de/schmitzm/data/resource/locales/DataResourceBundle_fr.properties
Log:
Added: trunk/schmitzm-core/src/main/java/de/schmitzm/sql/SqlUtil.java
===================================================================
--- trunk/schmitzm-core/src/main/java/de/schmitzm/sql/SqlUtil.java 2011-07-01 17:31:44 UTC (rev 1617)
+++ trunk/schmitzm-core/src/main/java/de/schmitzm/sql/SqlUtil.java 2011-07-07 10:50:48 UTC (rev 1618)
@@ -0,0 +1,61 @@
+package de.schmitzm.sql;
+
+/**
+ * Utilityklasse mit statisch Methoden für SQL.
+ */
+public class SqlUtil {
+
+ /**
+ * VZ steht füer VergleichsZustände un beschreibt was beim vergleich zweier
+ * attribute (.z.b. Hausnummer) alles rauskommen kann, wenn NULL gesondert
+ * betrachtet wird.
+ */
+ public enum VZ {
+ GLEICH, NULL1, NULL12, NULL2, UNGLEICH;
+
+ /**
+ * Drückt diesen Vergleichszustand als SQL aus.
+ */
+ public String toSql(String colName1, String colName2) {
+
+ switch (this) {
+ /**
+ * Beide column haben den selben wert
+ */
+ case GLEICH:
+ return "( (" + colName1 + " IS NOT NULL) AND (" + colName2
+ + " IS NOT NULL) AND (" + colName1 + " LIKE "
+ + colName2 + ") )";
+ /**
+ * Beide column sind nicht null und haben nicht den selben wert
+ */
+ case UNGLEICH:
+ return "( (" + colName1 + " IS NOT NULL) AND (" + colName2
+ + " IS NOT NULL) AND (NOT " + colName1 + " LIKE "
+ + colName2 + ") )";
+ /**
+ * die erste col is null, die zweite nicht
+ */
+ case NULL1:
+ return "( (" + colName1 + " IS NOT NULL) AND (" + colName2
+ + " IS NULL) )";
+ /**
+ * die zweite col is null, die erste nicht
+ */
+ case NULL2:
+ return "( (" + colName1 + " IS NOT NULL) AND (" + colName2
+ + " IS NULL) )";
+ /**
+ * beide col sind null
+ */
+ case NULL12:
+ return "( (" + colName1 + " IS NULL) AND (" + colName2
+ + " IS NULL) )";
+ }
+
+ throw new IllegalStateException("Kann " + this
+ + " nicht in SQL convertieren");
+ }
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/schmitzm-core/src/main/java/de/schmitzm/sql/SqlUtil.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/schmitzm-core/src/main/resources/de/schmitzm/data/resource/locales/DataResourceBundle_fr.properties
===================================================================
--- trunk/schmitzm-core/src/main/resources/de/schmitzm/data/resource/locales/DataResourceBundle_fr.properties 2011-07-01 17:31:44 UTC (rev 1617)
+++ trunk/schmitzm-core/src/main/resources/de/schmitzm/data/resource/locales/DataResourceBundle_fr.properties 2011-07-07 10:50:48 UTC (rev 1618)
@@ -1,22 +1,22 @@
-DistanceUnit.FEET=Pieds
-DistanceUnit.FEET.Abb=ft
-DistanceUnit.KM=Kilom\u00e8tre
-DistanceUnit.KM.Abb=km
-DistanceUnit.METERS=M\u00e8tre
-DistanceUnit.METERS.Abb=m
-DistanceUnit.MILES=Lieue
-DistanceUnit.MILES.Abb=mi
-DistanceUnit.YARDS=Yards
-DistanceUnit.YARDS.Abb=yt
-RasterDim.CellHeight=Hauteur de la cellule
-RasterDim.CellWidth=Largeur de la cellule
-RasterDim.ErrorMess=${0} de '${1}' n'est pas compatible \u00e0 '${2}'...
-RasterDim.GridHeight=Hauteur de la trame
-RasterDim.GridWidth=Largeur de la trame
-RasterDim.SampleType=Type de donn\u00e9e de la trame
-RasterOperationTree.AllowedIdx=permet: 0 \u00e0 ${0}
-RasterOperationTree.NoneAllowed=aucune autoris\u00e9e
-RasterOperationTree.err.FilterReferenceNotAllowed=Le filtre peut \u00eatre seulement appliqu\u00e9 sur des r\u00e9f\u00e9rences de la trame
-RasterOperationTree.err.InvalidFilterReference=R\u00e9f\u00e9rence de filtre non valide 'F${0}' (${1})
-RasterOperationTree.err.InvalidRasterReference=R\u00e9f\u00e9rence de filtre non valide '#${0}' (${1})
-RasterOperationTree.err.NonNumericResult=Le calculatrice de la trame peut seulement traiter des r\u00e9sultats num\u00e9riques: ${0}
+DistanceUnit.FEET=Pieds
+DistanceUnit.FEET.Abb=ft
+DistanceUnit.KM=Kilom\u00e8tre
+DistanceUnit.KM.Abb=km
+DistanceUnit.METERS=M\u00e8tre
+DistanceUnit.METERS.Abb=m
+DistanceUnit.MILES=Lieue
+DistanceUnit.MILES.Abb=mi
+DistanceUnit.YARDS=Yards
+DistanceUnit.YARDS.Abb=yt
+RasterDim.CellHeight=Hauteur de la cellule
+RasterDim.CellWidth=Largeur de la cellule
+RasterDim.ErrorMess=${0} de '${1}' n'est pas compatible \u00e0 '${2}'...
+RasterDim.GridHeight=Hauteur de la trame
+RasterDim.GridWidth=Largeur de la trame
+RasterDim.SampleType=Type de donn\u00e9e de la trame
+RasterOperationTree.AllowedIdx=permet: 0 \u00e0 ${0}
+RasterOperationTree.NoneAllowed=aucune autoris\u00e9e
+RasterOperationTree.err.FilterReferenceNotAllowed=Le filtre peut \u00eatre seulement appliqu\u00e9 sur des r\u00e9f\u00e9rences de la trame
+RasterOperationTree.err.InvalidFilterReference=R\u00e9f\u00e9rence de filtre non valide 'F${0}' (${1})
+RasterOperationTree.err.InvalidRasterReference=R\u00e9f\u00e9rence de filtre non valide '#${0}' (${1})
+RasterOperationTree.err.NonNumericResult=Le calculatrice de la trame peut seulement traiter des r\u00e9sultats num\u00e9riques: ${0}
More information about the Schmitzm-commits
mailing list