Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/Schema/MetaTableDefinitions.cs =================================================================== diff -u -r2ff863d4f541aa91cc29852317a4ff50b0fb71ed -r9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1 --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/Schema/MetaTableDefinitions.cs (.../MetaTableDefinitions.cs) (revision 2ff863d4f541aa91cc29852317a4ff50b0fb71ed) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/Schema/MetaTableDefinitions.cs (.../MetaTableDefinitions.cs) (revision 9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1) @@ -40,5 +40,10 @@ /// The name of the 'value' column. /// public const string Value = "Value"; + + /// + /// The value of the 'version' identifier in the 'value'-column. + /// + public const string ValueVersion = "VERSION"; } } \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SegmentPointReader.cs =================================================================== diff -u -r2dc7bb7aef782fd08d2474e14cc5486725896b38 -r9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1 --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SegmentPointReader.cs (.../SegmentPointReader.cs) (revision 2dc7bb7aef782fd08d2474e14cc5486725896b38) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SegmentPointReader.cs (.../SegmentPointReader.cs) (revision 9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1) @@ -146,7 +146,7 @@ /// /// Creates a new . /// - /// Thrown when query to fetch stochastic soil + /// Thrown when the query to fetch stochastic soil /// model segment points from the database failed. private void CreateDataReader() { Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilDatabaseConstraintsReader.cs =================================================================== diff -u -r36e7a0a258891013379258ea856d49351594666e -r9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1 --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilDatabaseConstraintsReader.cs (.../SoilDatabaseConstraintsReader.cs) (revision 36e7a0a258891013379258ea856d49351594666e) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilDatabaseConstraintsReader.cs (.../SoilDatabaseConstraintsReader.cs) (revision 9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1) @@ -37,12 +37,12 @@ { /// /// Creates a new instance of , - /// which will use the as its source. + /// that will use the as its source. /// /// The path of the database file to open. /// Thrown when: /// - /// The contains invalid characters. + /// The contains invalid characters; /// No file could be found at . /// /// @@ -120,16 +120,16 @@ /// Thrown when the execution the query failed. /// Thrown when: /// - /// The probabilities could not be read. - /// One or more probabilities are not valid. - /// A valid probability: + /// The probabilities could not be read; + /// One or more probabilities are not valid. + /// + /// + /// A valid probability: /// /// has a value in the interval [0.0, 1.0]; /// is not null. /// - /// - /// - /// + /// private void ReadAllProbabilitiesValid() { string checkSegmentNameUniqueness = SoilDatabaseQueryBuilder.GetStochasticSoilProfileProbabilitiesValidQuery(); Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilDatabaseQueryBuilder.cs =================================================================== diff -u -r261d8e56f76b7bb4f5c5be7082bc3dfcb281657c -r9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1 --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilDatabaseQueryBuilder.cs (.../SoilDatabaseQueryBuilder.cs) (revision 261d8e56f76b7bb4f5c5be7082bc3dfcb281657c) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilDatabaseQueryBuilder.cs (.../SoilDatabaseQueryBuilder.cs) (revision 9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1) @@ -32,19 +32,19 @@ "SELECT " + "mat.MA_ID, " + $"mat.MA_Name AS {SoilProfileTableDefinitions.MaterialName}, " + - $"max(case when pn.PN_Name = 'Color' then pv.PV_Value end) {SoilProfileTableDefinitions.Color}, " + - $"max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Dist_Type end) {SoilProfileTableDefinitions.BelowPhreaticLevelDistribution}, " + - $"max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Shift end) {SoilProfileTableDefinitions.BelowPhreaticLevelShift}, " + - $"max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Mean end) {SoilProfileTableDefinitions.BelowPhreaticLevelMean}, " + - $"max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Deviation end) {SoilProfileTableDefinitions.BelowPhreaticLevelDeviation}, " + - $"max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Dist_Type end) {SoilProfileTableDefinitions.PermeabilityDistribution}, " + - $"max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Shift end) {SoilProfileTableDefinitions.PermeabilityShift}, " + - $"max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Mean end) {SoilProfileTableDefinitions.PermeabilityMean}, " + - $"max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Variation end) {SoilProfileTableDefinitions.PermeabilityCoefficientOfVariation}, " + - $"max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Dist_Type end) {SoilProfileTableDefinitions.DiameterD70Distribution}, " + - $"max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Shift end) {SoilProfileTableDefinitions.DiameterD70Shift}, " + - $"max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Mean end) {SoilProfileTableDefinitions.DiameterD70Mean}, " + - $"max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Variation end) {SoilProfileTableDefinitions.DiameterD70CoefficientOfVariation} " + + $"max(case when pn.PN_Name = 'Color' then pv.PV_Value end) AS {SoilProfileTableDefinitions.Color}, " + + $"max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Dist_Type end) AS {SoilProfileTableDefinitions.BelowPhreaticLevelDistribution}, " + + $"max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Shift end) AS {SoilProfileTableDefinitions.BelowPhreaticLevelShift}, " + + $"max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Mean end) AS {SoilProfileTableDefinitions.BelowPhreaticLevelMean}, " + + $"max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Deviation end) AS {SoilProfileTableDefinitions.BelowPhreaticLevelDeviation}, " + + $"max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Dist_Type end) AS {SoilProfileTableDefinitions.PermeabilityDistribution}, " + + $"max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Shift end) AS {SoilProfileTableDefinitions.PermeabilityShift}, " + + $"max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Mean end) AS {SoilProfileTableDefinitions.PermeabilityMean}, " + + $"max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Variation end) AS {SoilProfileTableDefinitions.PermeabilityCoefficientOfVariation}, " + + $"max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Dist_Type end) AS {SoilProfileTableDefinitions.DiameterD70Distribution}, " + + $"max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Shift end) AS {SoilProfileTableDefinitions.DiameterD70Shift}, " + + $"max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Mean end) AS {SoilProfileTableDefinitions.DiameterD70Mean}, " + + $"max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Variation end) AS {SoilProfileTableDefinitions.DiameterD70CoefficientOfVariation} " + "FROM ParameterNames AS pn " + "LEFT JOIN ParameterValues AS pv USING(PN_ID) " + "LEFT JOIN Stochast AS s USING(PN_ID) " + @@ -62,7 +62,7 @@ { return $"SELECT {MetaTableDefinitions.Value} " + $"FROM {MetaTableDefinitions.TableName} " + - $"WHERE {MetaTableDefinitions.Key} = 'VERSION' " + + $"WHERE {MetaTableDefinitions.Key} = '{MetaTableDefinitions.ValueVersion}' " + $"AND {MetaTableDefinitions.Value} = @{MetaTableDefinitions.Value};"; } @@ -91,9 +91,9 @@ public static string GetStochasticSoilModelOfMechanismCountQuery() { return $"SELECT COUNT() AS {StochasticSoilModelTableDefinitions.Count} " + - $"FROM {StochasticSoilModelTableDefinitions.TableName} SSM " + - $"INNER JOIN {SegmentTableDefinitions.TableName} S USING({StochasticSoilModelTableDefinitions.StochasticSoilModelId}) " + - $"INNER JOIN {MechanismTableDefinitions.TableName} M USING({MechanismTableDefinitions.MechanismId});"; + $"FROM {StochasticSoilModelTableDefinitions.TableName} SSM " + + $"INNER JOIN {SegmentTableDefinitions.TableName} S USING({StochasticSoilModelTableDefinitions.StochasticSoilModelId}) " + + $"INNER JOIN {MechanismTableDefinitions.TableName} M USING({MechanismTableDefinitions.MechanismId});"; } /// @@ -120,7 +120,8 @@ public static string GetStochasticSoilModelPerMechanismQuery() { return $"SELECT SSM.{StochasticSoilModelTableDefinitions.StochasticSoilModelId}, " + - $"M.{MechanismTableDefinitions.MechanismId}, M.{MechanismTableDefinitions.MechanismName}, " + + $"M.{MechanismTableDefinitions.MechanismId}, " + + $"M.{MechanismTableDefinitions.MechanismName}, " + $"SSM.{StochasticSoilModelTableDefinitions.StochasticSoilModelName}, " + $"SSP.{StochasticSoilProfileTableDefinitions.Probability}, " + $"SSP.{StochasticSoilProfileTableDefinitions.SoilProfile1DId}, " + @@ -189,12 +190,12 @@ $"{SoilProfileTableDefinitions.PermeabilityCoefficientOfVariation}, " + $"sp1d.SP1D_ID AS {SoilProfileTableDefinitions.SoilProfileId} " + "FROM Segment AS segment " + - "JOIN (SELECT SSM_ID, SP1D_ID, SP2D_ID FROM StochasticSoilProfile GROUP BY SSM_ID, SP1D_ID, SP2D_ID) ssp USING(SSM_ID) " + + "JOIN (SELECT SSM_ID, SP1D_ID FROM StochasticSoilProfile GROUP BY SSM_ID, SP1D_ID) ssp USING(SSM_ID) " + "JOIN SoilProfile1D sp1d USING(SP1D_ID) " + $"JOIN ({getNumberOfLayerProfile1DQuery}) {SoilProfileTableDefinitions.LayerCount} USING(SP1D_ID) " + "JOIN SoilLayer1D sl1d USING(SP1D_ID) " + $"LEFT JOIN ({getMaterialPropertiesOfLayerQuery}) materialProperties USING(MA_ID) " + - $"LEFT JOIN ({getLayerPropertiesOfLayer1DQuery}) layerProperties USING(SL1D_ID) " + + $"LEFT JOIN ({getLayerPropertiesOfLayer1DQuery}) USING(SL1D_ID) " + "GROUP BY sp1d.SP1D_ID, sl1d.SL1D_ID;"; } @@ -239,13 +240,13 @@ $"sp2d.SP2D_ID AS {SoilProfileTableDefinitions.SoilProfileId} " + $"FROM {MechanismTableDefinitions.TableName} AS m " + $"JOIN {SegmentTableDefinitions.TableName} AS segment USING({MechanismTableDefinitions.MechanismId}) " + - "JOIN (SELECT SSM_ID, SP1D_ID, SP2D_ID FROM StochasticSoilProfile GROUP BY SSM_ID, SP1D_ID, SP2D_ID) ssp USING(SSM_ID) " + + "JOIN (SELECT SSM_ID, SP2D_ID FROM StochasticSoilProfile GROUP BY SSM_ID, SP2D_ID) ssp USING(SSM_ID) " + "JOIN SoilProfile2D sp2d USING(SP2D_ID) " + $"JOIN ({getNumberOfLayerProfile2DQuery}) {SoilProfileTableDefinitions.LayerCount} USING(SP2D_ID) " + "JOIN SoilLayer2D sl2d USING(SP2D_ID) " + "LEFT JOIN MechanismPointLocation mpl USING(ME_ID, SP2D_ID) " + $"LEFT JOIN ({getMaterialPropertiesOfLayerQuery}) materialProperties USING(MA_ID) " + - $"LEFT JOIN ({getLayerPropertiesOfLayer2DQuery}) layerProperties USING(SL2D_ID) " + + $"LEFT JOIN ({getLayerPropertiesOfLayer2DQuery}) USING(SL2D_ID) " + "GROUP BY sp2d.SP2D_ID, sl2d.SL2D_ID;"; } } Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilDatabaseVersionReader.cs =================================================================== diff -u -rb5404a5a71bbedaa91bbcc5aee55c690a063aa8d -r9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1 --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilDatabaseVersionReader.cs (.../SoilDatabaseVersionReader.cs) (revision b5404a5a71bbedaa91bbcc5aee55c690a063aa8d) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilDatabaseVersionReader.cs (.../SoilDatabaseVersionReader.cs) (revision 9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1) @@ -37,7 +37,7 @@ private const string databaseRequiredVersion = "17.2.0.0"; /// - /// Creates a new instance of , + /// Creates a new instance of /// which will use the as its source. /// /// The path of the database file to open. Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilLayer1D.cs =================================================================== diff -u -recd4d4b6e6b86aea559e4dee86f46850ee1477bf -r9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1 --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilLayer1D.cs (.../SoilLayer1D.cs) (revision ecd4d4b6e6b86aea559e4dee86f46850ee1477bf) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilLayer1D.cs (.../SoilLayer1D.cs) (revision 9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1) @@ -22,13 +22,12 @@ namespace Ringtoets.Common.IO.SoilProfile { /// - /// This class represents profiles that were imported from D-Soil Model and will later on - /// be used to create the necessary input for executing a calculation. + /// A one-dimensional soil layer that was imported from D-Soil Model. /// public class SoilLayer1D : SoilLayerBase { /// - /// Creates a new instance of , where the top is set to . + /// Creates a new instance of that has the top is set to . /// /// The top level of the layer. public SoilLayer1D(double top) Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilLayer2D.cs =================================================================== diff -u -re00c710f89f381dd32218997530690b900f349cc -r9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1 --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilLayer2D.cs (.../SoilLayer2D.cs) (revision e00c710f89f381dd32218997530690b900f349cc) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilLayer2D.cs (.../SoilLayer2D.cs) (revision 9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1) @@ -29,9 +29,7 @@ namespace Ringtoets.Common.IO.SoilProfile { /// - /// This class represents objects which were imported from a D-Soil Model database. - /// Instances of this class are transient and are not to be used once the D-Soil Model - /// database has been imported. + /// A two-dimensional soil layer that was imported from D-Soil Model. /// public class SoilLayer2D : SoilLayerBase { @@ -100,7 +98,7 @@ /// /// Validates that forms a loop. /// - /// + /// The inner loop to validate. /// Thrown when the in /// do not form a loop. private static void CheckValidLoop(Segment2D[] innerLoop) Index: Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilLayer2DReader.cs =================================================================== diff -u -r36e7a0a258891013379258ea856d49351594666e -r9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1 --- Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilLayer2DReader.cs (.../SoilLayer2DReader.cs) (revision 36e7a0a258891013379258ea856d49351594666e) +++ Ringtoets/Common/src/Ringtoets.Common.IO/SoilProfile/SoilLayer2DReader.cs (.../SoilLayer2DReader.cs) (revision 9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1) @@ -50,10 +50,8 @@ private readonly XmlSchemaSet schema; /// - /// Constructs an instance of . + /// Creates a new instance of . /// - /// Thrown when the XML-schema - /// could not be loaded. public SoilLayer2DReader() { schema = LoadXmlSchema(); @@ -122,8 +120,7 @@ /// Validates the to the . /// /// The to validate. - /// Thrown when the validation failed. - /// + /// Thrown when the validation failed. private void ValidateToSchema(XDocument document) { try Index: Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/SoilDatabaseQueryBuilderTest.cs =================================================================== diff -u -r133fb73ed33467075fa1317ab736902755ff6e4f -r9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1 --- Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/SoilDatabaseQueryBuilderTest.cs (.../SoilDatabaseQueryBuilderTest.cs) (revision 133fb73ed33467075fa1317ab736902755ff6e4f) +++ Ringtoets/Common/test/Ringtoets.Common.IO.Test/SoilProfile/SoilDatabaseQueryBuilderTest.cs (.../SoilDatabaseQueryBuilderTest.cs) (revision 9d56d6d370c1a05eebb62ca4cc58aa9036c27bf1) @@ -150,9 +150,9 @@ "FROM Segment AS segment " + "JOIN " + "(" + - "SELECT SSM_ID, SP1D_ID, SP2D_ID " + + "SELECT SSM_ID, SP1D_ID " + "FROM StochasticSoilProfile " + - "GROUP BY SSM_ID, SP1D_ID, SP2D_ID" + + "GROUP BY SSM_ID, SP1D_ID" + ") ssp USING(SSM_ID) " + "JOIN SoilProfile1D sp1d USING(SP1D_ID) " + "JOIN " + @@ -167,19 +167,19 @@ "SELECT " + "mat.MA_ID, " + "mat.MA_Name AS MaterialName, " + - "max(case when pn.PN_Name = 'Color' then pv.PV_Value end) Color, " + - "max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Dist_Type end) BelowPhreaticLevelDistribution, " + - "max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Shift end) BelowPhreaticLevelShift, " + - "max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Mean end) BelowPhreaticLevelMean, " + - "max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Deviation end) BelowPhreaticLevelDeviation, " + - "max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Dist_Type end) PermeabKxDistribution, " + - "max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Shift end) PermeabKxShift, " + - "max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Mean end) PermeabKxMean, " + - "max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Variation end) PermeabKxCoefficientOfVariation, " + - "max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Dist_Type end) DiameterD70Distribution, " + - "max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Shift end) DiameterD70Shift, " + - "max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Mean end) DiameterD70Mean, " + - "max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Variation end) DiameterD70CoefficientOfVariation " + + "max(case when pn.PN_Name = 'Color' then pv.PV_Value end) AS Color, " + + "max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Dist_Type end) AS BelowPhreaticLevelDistribution, " + + "max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Shift end) AS BelowPhreaticLevelShift, " + + "max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Mean end) AS BelowPhreaticLevelMean, " + + "max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Deviation end) AS BelowPhreaticLevelDeviation, " + + "max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Dist_Type end) AS PermeabKxDistribution, " + + "max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Shift end) AS PermeabKxShift, " + + "max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Mean end) AS PermeabKxMean, " + + "max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Variation end) AS PermeabKxCoefficientOfVariation, " + + "max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Dist_Type end) AS DiameterD70Distribution, " + + "max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Shift end) AS DiameterD70Shift, " + + "max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Mean end) AS DiameterD70Mean, " + + "max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Variation end) AS DiameterD70CoefficientOfVariation " + "FROM ParameterNames AS pn " + "LEFT JOIN ParameterValues AS pv USING(PN_ID) " + "LEFT JOIN Stochast AS s USING(PN_ID) " + @@ -192,7 +192,7 @@ "FROM ParameterNames " + "JOIN LayerParameterValues USING(PN_ID) " + "WHERE PN_NAME = 'IsAquifer'" + - ") layerProperties USING(SL1D_ID) " + + ") USING(SL1D_ID) " + "GROUP BY sp1d.SP1D_ID, sl1d.SL1D_ID;"; Assert.AreEqual(expectedQuery, query); } @@ -229,9 +229,9 @@ "JOIN Segment AS segment USING(ME_ID) " + "JOIN " + "(" + - "SELECT SSM_ID, SP1D_ID, SP2D_ID " + + "SELECT SSM_ID, SP2D_ID " + "FROM StochasticSoilProfile " + - "GROUP BY SSM_ID, SP1D_ID, SP2D_ID" + + "GROUP BY SSM_ID, SP2D_ID" + ") ssp USING(SSM_ID) " + "JOIN SoilProfile2D sp2d USING(SP2D_ID) " + "JOIN " + @@ -246,19 +246,19 @@ "(" + "SELECT " + "mat.MA_ID, mat.MA_Name AS MaterialName, " + - "max(case when pn.PN_Name = 'Color' then pv.PV_Value end) Color, " + - "max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Dist_Type end) BelowPhreaticLevelDistribution, " + - "max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Shift end) BelowPhreaticLevelShift, " + - "max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Mean end) BelowPhreaticLevelMean, " + - "max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Deviation end) BelowPhreaticLevelDeviation, " + - "max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Dist_Type end) PermeabKxDistribution, " + - "max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Shift end) PermeabKxShift, " + - "max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Mean end) PermeabKxMean, " + - "max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Variation end) PermeabKxCoefficientOfVariation, " + - "max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Dist_Type end) DiameterD70Distribution, " + - "max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Shift end) DiameterD70Shift, " + - "max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Mean end) DiameterD70Mean, " + - "max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Variation end) DiameterD70CoefficientOfVariation " + + "max(case when pn.PN_Name = 'Color' then pv.PV_Value end) AS Color, " + + "max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Dist_Type end) AS BelowPhreaticLevelDistribution, " + + "max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Shift end) AS BelowPhreaticLevelShift, " + + "max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Mean end) AS BelowPhreaticLevelMean, " + + "max(case when pn.PN_Name = 'BelowPhreaticLevelStochast' then s.ST_Deviation end) AS BelowPhreaticLevelDeviation, " + + "max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Dist_Type end) AS PermeabKxDistribution, " + + "max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Shift end) AS PermeabKxShift, " + + "max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Mean end) AS PermeabKxMean, " + + "max(case when pn.PN_Name = 'PermeabKxStochast' then s.ST_Variation end) AS PermeabKxCoefficientOfVariation, " + + "max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Dist_Type end) AS DiameterD70Distribution, " + + "max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Shift end) AS DiameterD70Shift, " + + "max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Mean end) AS DiameterD70Mean, " + + "max(case when pn.PN_Name = 'DiameterD70Stochast' then s.ST_Variation end) AS DiameterD70CoefficientOfVariation " + "FROM ParameterNames AS pn " + "LEFT JOIN ParameterValues AS pv USING(PN_ID) " + "LEFT JOIN Stochast AS s USING(PN_ID) " + @@ -272,7 +272,7 @@ "FROM ParameterNames " + "JOIN LayerParameterValues USING(PN_ID) " + "WHERE PN_NAME = 'IsAquifer'" + - ") layerProperties USING(SL2D_ID) " + + ") USING(SL2D_ID) " + "GROUP BY sp2d.SP2D_ID, sl2d.SL2D_ID;"; Assert.AreEqual(expectedQuery, query); }