diff --git a/Kalliope.DTO/AutoGenDto/ConstraintRoleSequenceWithJoin.cs b/Kalliope.DTO/AutoGenDto/ConstraintRoleSequenceWithJoin.cs
index 3bec0b1b..7cb2ecbd 100644
--- a/Kalliope.DTO/AutoGenDto/ConstraintRoleSequenceWithJoin.cs
+++ b/Kalliope.DTO/AutoGenDto/ConstraintRoleSequenceWithJoin.cs
@@ -33,12 +33,12 @@ namespace Kalliope.DTO
/// A Data Transfer Object that represents a ConstraintRoleSequenceWithJoin
///
[Container(typeName: "SetConstraintWithJoin", propertyName: "RoleSequence")]
- public partial class ConstraintRoleSequenceWithJoin : OrmNamedElement
+ public abstract partial class ConstraintRoleSequenceWithJoin : OrmNamedElement
{
///
/// Initializes a new instance of the class.
///
- public ConstraintRoleSequenceWithJoin()
+ protected ConstraintRoleSequenceWithJoin()
{
this.Roles = new List();
}
@@ -50,18 +50,18 @@ public ConstraintRoleSequenceWithJoin()
///
- /// Gets or sets the unique identifier of the contained
+ /// Gets or sets the unique identifier of the contained
///
[Description("")]
- [Property(name: "JoinPath", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "ConstraintRoleSequenceJoinPath", allowOverride: false, isOverride: false, isDerived: false)]
- public string JoinPath { get; set; }
+ [Property(name: "JoinPathRequiredError", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "JoinPathRequiredError", allowOverride: false, isOverride: false, isDerived: false)]
+ public string JoinPathRequiredError { get; set; }
///
- /// Gets or sets the unique identifier of the contained
+ /// Gets or sets the unique identifier of the contained
///
[Description("")]
- [Property(name: "JoinPathRequiredError", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "JoinPathRequiredError", allowOverride: false, isOverride: false, isDerived: false)]
- public string JoinPathRequiredError { get; set; }
+ [Property(name: "JoinRule", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "JoinRule", allowOverride: false, isOverride: false, isDerived: false)]
+ public string JoinRule { get; set; }
///
/// Gets or sets a list unique identifiers of the contained instances
diff --git a/Kalliope.DTO/AutoGenDto/ConstraintRoleSequenceWithJoinAndId.cs b/Kalliope.DTO/AutoGenDto/ConstraintRoleSequenceWithJoinAndId.cs
new file mode 100644
index 00000000..9253f09e
--- /dev/null
+++ b/Kalliope.DTO/AutoGenDto/ConstraintRoleSequenceWithJoinAndId.cs
@@ -0,0 +1,50 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2023 RHEA System S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
+
+namespace Kalliope.DTO
+{
+ using System;
+ using System.Collections.Generic;
+
+ using Kalliope.Common;
+
+ ///
+ /// A Data Transfer Object that represents a ConstraintRoleSequenceWithJoinAndId
+ ///
+ [Container(typeName: "ConstraintRoleSequences", propertyName: "RoleSequence")]
+ public partial class ConstraintRoleSequenceWithJoinAndId : ConstraintRoleSequenceWithJoin
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public ConstraintRoleSequenceWithJoinAndId()
+ {
+ }
+
+ }
+}
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
diff --git a/Kalliope.DTO/AutoGenDto/ConstraintRoleSequences.cs b/Kalliope.DTO/AutoGenDto/ConstraintRoleSequences.cs
new file mode 100644
index 00000000..1278daa5
--- /dev/null
+++ b/Kalliope.DTO/AutoGenDto/ConstraintRoleSequences.cs
@@ -0,0 +1,64 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2023 RHEA System S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
+
+namespace Kalliope.DTO
+{
+ using System;
+ using System.Collections.Generic;
+
+ using Kalliope.Common;
+
+ ///
+ /// A Data Transfer Object that represents a ConstraintRoleSequences
+ ///
+ [Container(typeName: "SetConstraint", propertyName: "RoleSequences")]
+ public partial class ConstraintRoleSequences : OrmNamedElement
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public ConstraintRoleSequences()
+ {
+ this.RoleSequence = new List();
+ }
+
+ ///
+ /// Gets or sets the unique identifier of the container
+ ///
+ public string Container {get; set;}
+
+
+ ///
+ /// Gets or sets a list unique identifiers of the contained instances
+ ///
+ [Description("")]
+ [Property(name: "RoleSequence", aggregation: AggregationKind.Composite, multiplicity: "0..*", typeKind: TypeKind.Object, defaultValue: "", typeName: "ConstraintRoleSequenceWithJoinAndId", allowOverride: false, isOverride: false, isDerived: false)]
+ public List RoleSequence { get; set; }
+
+ }
+}
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
diff --git a/Kalliope.DTO/AutoGenDto/JoinRule.cs b/Kalliope.DTO/AutoGenDto/JoinRule.cs
new file mode 100644
index 00000000..61e590e5
--- /dev/null
+++ b/Kalliope.DTO/AutoGenDto/JoinRule.cs
@@ -0,0 +1,70 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2023 RHEA System S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
+
+namespace Kalliope.DTO
+{
+ using System;
+ using System.Collections.Generic;
+
+ using Kalliope.Common;
+
+ ///
+ /// A Data Transfer Object that represents a JoinRule
+ ///
+ [Container(typeName: "ConstraintRoleSequenceWithJoin", propertyName: "JoinRule")]
+ public partial class JoinRule : ModelThing
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public JoinRule()
+ {
+ }
+
+ ///
+ /// Gets or sets the unique identifier of the container
+ ///
+ public string Container {get; set;}
+
+
+ ///
+ /// Gets or sets the unique identifier of the contained
+ ///
+ [Description("")]
+ [Property(name: "JoinPath", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "ConstraintRoleSequenceJoinPath", allowOverride: false, isOverride: false, isDerived: false)]
+ public string JoinPath { get; set; }
+
+ ///
+ /// Gets or sets the unique identifier of the contained
+ ///
+ [Description("")]
+ [Property(name: "JoinPathRequiredError", aggregation: AggregationKind.Composite, multiplicity: "0..1", typeKind: TypeKind.Object, defaultValue: "", typeName: "JoinPathRequiredError", allowOverride: false, isOverride: false, isDerived: false)]
+ public string JoinPathRequiredError { get; set; }
+
+ }
+}
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
diff --git a/Kalliope.Dal/AutoGenExtension/ConstraintRoleSequenceWithJoinAndIdExtensions.cs b/Kalliope.Dal/AutoGenExtension/ConstraintRoleSequenceWithJoinAndIdExtensions.cs
new file mode 100644
index 00000000..6cb5a3b6
--- /dev/null
+++ b/Kalliope.Dal/AutoGenExtension/ConstraintRoleSequenceWithJoinAndIdExtensions.cs
@@ -0,0 +1,210 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2023 RHEA System S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
+
+namespace Kalliope.Dal
+{
+ using System;
+ using System.Collections.Concurrent;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ using Kalliope.Absorption;
+ using Kalliope.Common;
+ using Kalliope.Core;
+ using Kalliope.CustomProperties;
+ using Kalliope.Diagrams;
+
+ ///
+ /// A static class that provides extension methods for the class
+ ///
+ public static class ConstraintRoleSequenceWithJoinAndIdExtensions
+ {
+ ///
+ /// Updates the value properties of the by setting the value equal to that of the dto
+ /// Removes deleted objects from the reference properties and returns the unique identifiers
+ /// of the objects that have been removed from properties
+ ///
+ ///
+ /// The that is to be updated
+ ///
+ ///
+ /// The DTO that is used to update the with
+ ///
+ ///
+ /// The unique identifiers of the objects that have been removed from properties
+ ///
+ ///
+ /// Thrown when the or is null
+ ///
+ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Kalliope.Core.ConstraintRoleSequenceWithJoinAndId poco, Kalliope.DTO.ConstraintRoleSequenceWithJoinAndId dto)
+ {
+ if (poco == null)
+ {
+ throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null");
+ }
+
+ if (dto == null)
+ {
+ throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null");
+ }
+
+ var identifiersOfObjectsToDelete = new List();
+
+ var associatedModelErrorsToDelete = poco.AssociatedModelErrors.Select(x => x.Id).Except(dto.AssociatedModelErrors);
+ foreach (var identifier in associatedModelErrorsToDelete)
+ {
+ var modelError = poco.AssociatedModelErrors.Single(x => x.Id == identifier);
+ poco.AssociatedModelErrors.Remove(modelError);
+ }
+
+ var extensionModelErrorsToDelete = poco.ExtensionModelErrors.Select(x => x.Id).Except(dto.ExtensionModelErrors);
+ foreach (var identifier in extensionModelErrorsToDelete)
+ {
+ var modelError = poco.ExtensionModelErrors.Single(x => x.Id == identifier);
+ poco.ExtensionModelErrors.Remove(modelError);
+ }
+
+ var extensionsToDelete = poco.Extensions.Select(x => x.Id).Except(dto.Extensions);
+ identifiersOfObjectsToDelete.AddRange(extensionsToDelete);
+ foreach (var identifier in extensionsToDelete)
+ {
+ var extension = poco.Extensions.Single(x => x.Id == identifier);
+ poco.Extensions.Remove(extension);
+ }
+
+ if (poco.JoinPathRequiredError != null && poco.JoinPathRequiredError.Id != dto.JoinPathRequiredError)
+ {
+ identifiersOfObjectsToDelete.Add(poco.JoinPathRequiredError.Id);
+ poco.JoinPathRequiredError = null;
+ }
+
+ if (poco.JoinRule != null && poco.JoinRule.Id != dto.JoinRule)
+ {
+ identifiersOfObjectsToDelete.Add(poco.JoinRule.Id);
+ poco.JoinRule = null;
+ }
+
+ poco.Name = dto.Name;
+
+ var rolesToDelete = poco.Roles.Select(x => x.Id).Except(dto.Roles);
+ identifiersOfObjectsToDelete.AddRange(rolesToDelete);
+ foreach (var identifier in rolesToDelete)
+ {
+ var roleBase = poco.Roles.Single(x => x.Id == identifier);
+ poco.Roles.Remove(roleBase);
+ }
+
+ return identifiersOfObjectsToDelete;
+ }
+
+ ///
+ /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO
+ /// and the provided cache to find the referenced object.
+ ///
+ ///
+ /// The that is to be updated
+ ///
+ ///
+ /// The DTO that is used to update the with
+ ///
+ ///
+ /// The that contains the
+ /// s that are know and cached.
+ ///
+ ///
+ public static void UpdateReferenceProperties(this Kalliope.Core.ConstraintRoleSequenceWithJoinAndId poco, Kalliope.DTO.ConstraintRoleSequenceWithJoinAndId dto, ConcurrentDictionary> cache)
+ {
+ if (poco == null)
+ {
+ throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null");
+ }
+
+ if (dto == null)
+ {
+ throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null");
+ }
+
+ if (cache == null)
+ {
+ throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null");
+ }
+
+ Lazy lazyPoco;
+
+ var associatedModelErrorsToAdd = dto.AssociatedModelErrors.Except(poco.AssociatedModelErrors.Select(x => x.Id));
+ foreach (var identifier in associatedModelErrorsToAdd)
+ {
+ if (cache.TryGetValue(identifier, out lazyPoco))
+ {
+ var modelError = (ModelError)lazyPoco.Value;
+ poco.AssociatedModelErrors.Add(modelError);
+ }
+ }
+
+ var extensionModelErrorsToAdd = dto.ExtensionModelErrors.Except(poco.ExtensionModelErrors.Select(x => x.Id));
+ foreach (var identifier in extensionModelErrorsToAdd)
+ {
+ if (cache.TryGetValue(identifier, out lazyPoco))
+ {
+ var modelError = (ModelError)lazyPoco.Value;
+ poco.ExtensionModelErrors.Add(modelError);
+ }
+ }
+
+ var extensionsToAdd = dto.Extensions.Except(poco.Extensions.Select(x => x.Id));
+ foreach (var identifier in extensionsToAdd)
+ {
+ if (cache.TryGetValue(identifier, out lazyPoco))
+ {
+ var extension = (Extension)lazyPoco.Value;
+ poco.Extensions.Add(extension);
+ }
+ }
+
+ if (poco.JoinPathRequiredError == null && !string.IsNullOrEmpty(dto.JoinPathRequiredError) && cache.TryGetValue(dto.JoinPathRequiredError, out lazyPoco))
+ {
+ poco.JoinPathRequiredError = (JoinPathRequiredError)lazyPoco.Value;
+ }
+
+ if (poco.JoinRule == null && !string.IsNullOrEmpty(dto.JoinRule) && cache.TryGetValue(dto.JoinRule, out lazyPoco))
+ {
+ poco.JoinRule = (JoinRule)lazyPoco.Value;
+ }
+
+ var rolesToAdd = dto.Roles.Except(poco.Roles.Select(x => x.Id));
+ foreach (var identifier in rolesToAdd)
+ {
+ if (cache.TryGetValue(identifier, out lazyPoco))
+ {
+ var roleBase = (RoleBase)lazyPoco.Value;
+ poco.Roles.Add(roleBase);
+ }
+ }
+ }
+ }
+}
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
diff --git a/Kalliope.Dal/AutoGenExtension/ConstraintRoleSequenceWithJoinExtensions.cs b/Kalliope.Dal/AutoGenExtension/ConstraintRoleSequenceWithJoinExtensions.cs
index 40960bec..65f3436a 100644
--- a/Kalliope.Dal/AutoGenExtension/ConstraintRoleSequenceWithJoinExtensions.cs
+++ b/Kalliope.Dal/AutoGenExtension/ConstraintRoleSequenceWithJoinExtensions.cs
@@ -93,18 +93,18 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties
poco.Extensions.Remove(extension);
}
- if (poco.JoinPath != null && poco.JoinPath.Id != dto.JoinPath)
- {
- identifiersOfObjectsToDelete.Add(poco.JoinPath.Id);
- poco.JoinPath = null;
- }
-
if (poco.JoinPathRequiredError != null && poco.JoinPathRequiredError.Id != dto.JoinPathRequiredError)
{
identifiersOfObjectsToDelete.Add(poco.JoinPathRequiredError.Id);
poco.JoinPathRequiredError = null;
}
+ if (poco.JoinRule != null && poco.JoinRule.Id != dto.JoinRule)
+ {
+ identifiersOfObjectsToDelete.Add(poco.JoinRule.Id);
+ poco.JoinRule = null;
+ }
+
poco.Name = dto.Name;
var rolesToDelete = poco.Roles.Select(x => x.Id).Except(dto.Roles);
@@ -182,14 +182,14 @@ public static void UpdateReferenceProperties(this Kalliope.Core.ConstraintRoleSe
}
}
- if (poco.JoinPath == null && !string.IsNullOrEmpty(dto.JoinPath) && cache.TryGetValue(dto.JoinPath, out lazyPoco))
+ if (poco.JoinPathRequiredError == null && !string.IsNullOrEmpty(dto.JoinPathRequiredError) && cache.TryGetValue(dto.JoinPathRequiredError, out lazyPoco))
{
- poco.JoinPath = (ConstraintRoleSequenceJoinPath)lazyPoco.Value;
+ poco.JoinPathRequiredError = (JoinPathRequiredError)lazyPoco.Value;
}
- if (poco.JoinPathRequiredError == null && !string.IsNullOrEmpty(dto.JoinPathRequiredError) && cache.TryGetValue(dto.JoinPathRequiredError, out lazyPoco))
+ if (poco.JoinRule == null && !string.IsNullOrEmpty(dto.JoinRule) && cache.TryGetValue(dto.JoinRule, out lazyPoco))
{
- poco.JoinPathRequiredError = (JoinPathRequiredError)lazyPoco.Value;
+ poco.JoinRule = (JoinRule)lazyPoco.Value;
}
var rolesToAdd = dto.Roles.Except(poco.Roles.Select(x => x.Id));
diff --git a/Kalliope.Dal/AutoGenExtension/ConstraintRoleSequencesExtensions.cs b/Kalliope.Dal/AutoGenExtension/ConstraintRoleSequencesExtensions.cs
new file mode 100644
index 00000000..e2dd0c1e
--- /dev/null
+++ b/Kalliope.Dal/AutoGenExtension/ConstraintRoleSequencesExtensions.cs
@@ -0,0 +1,188 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2023 RHEA System S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
+
+namespace Kalliope.Dal
+{
+ using System;
+ using System.Collections.Concurrent;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ using Kalliope.Absorption;
+ using Kalliope.Common;
+ using Kalliope.Core;
+ using Kalliope.CustomProperties;
+ using Kalliope.Diagrams;
+
+ ///
+ /// A static class that provides extension methods for the class
+ ///
+ public static class ConstraintRoleSequencesExtensions
+ {
+ ///
+ /// Updates the value properties of the by setting the value equal to that of the dto
+ /// Removes deleted objects from the reference properties and returns the unique identifiers
+ /// of the objects that have been removed from properties
+ ///
+ ///
+ /// The that is to be updated
+ ///
+ ///
+ /// The DTO that is used to update the with
+ ///
+ ///
+ /// The unique identifiers of the objects that have been removed from properties
+ ///
+ ///
+ /// Thrown when the or is null
+ ///
+ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Kalliope.Core.ConstraintRoleSequences poco, Kalliope.DTO.ConstraintRoleSequences dto)
+ {
+ if (poco == null)
+ {
+ throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null");
+ }
+
+ if (dto == null)
+ {
+ throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null");
+ }
+
+ var identifiersOfObjectsToDelete = new List();
+
+ var associatedModelErrorsToDelete = poco.AssociatedModelErrors.Select(x => x.Id).Except(dto.AssociatedModelErrors);
+ foreach (var identifier in associatedModelErrorsToDelete)
+ {
+ var modelError = poco.AssociatedModelErrors.Single(x => x.Id == identifier);
+ poco.AssociatedModelErrors.Remove(modelError);
+ }
+
+ var extensionModelErrorsToDelete = poco.ExtensionModelErrors.Select(x => x.Id).Except(dto.ExtensionModelErrors);
+ foreach (var identifier in extensionModelErrorsToDelete)
+ {
+ var modelError = poco.ExtensionModelErrors.Single(x => x.Id == identifier);
+ poco.ExtensionModelErrors.Remove(modelError);
+ }
+
+ var extensionsToDelete = poco.Extensions.Select(x => x.Id).Except(dto.Extensions);
+ identifiersOfObjectsToDelete.AddRange(extensionsToDelete);
+ foreach (var identifier in extensionsToDelete)
+ {
+ var extension = poco.Extensions.Single(x => x.Id == identifier);
+ poco.Extensions.Remove(extension);
+ }
+
+ poco.Name = dto.Name;
+
+ var roleSequenceToDelete = poco.RoleSequence.Select(x => x.Id).Except(dto.RoleSequence);
+ identifiersOfObjectsToDelete.AddRange(roleSequenceToDelete);
+ foreach (var identifier in roleSequenceToDelete)
+ {
+ var constraintRoleSequenceWithJoinAndId = poco.RoleSequence.Single(x => x.Id == identifier);
+ poco.RoleSequence.Remove(constraintRoleSequenceWithJoinAndId);
+ }
+
+ return identifiersOfObjectsToDelete;
+ }
+
+ ///
+ /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO
+ /// and the provided cache to find the referenced object.
+ ///
+ ///
+ /// The that is to be updated
+ ///
+ ///
+ /// The DTO that is used to update the with
+ ///
+ ///
+ /// The that contains the
+ /// s that are know and cached.
+ ///
+ ///
+ public static void UpdateReferenceProperties(this Kalliope.Core.ConstraintRoleSequences poco, Kalliope.DTO.ConstraintRoleSequences dto, ConcurrentDictionary> cache)
+ {
+ if (poco == null)
+ {
+ throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null");
+ }
+
+ if (dto == null)
+ {
+ throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null");
+ }
+
+ if (cache == null)
+ {
+ throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null");
+ }
+
+ Lazy lazyPoco;
+
+ var associatedModelErrorsToAdd = dto.AssociatedModelErrors.Except(poco.AssociatedModelErrors.Select(x => x.Id));
+ foreach (var identifier in associatedModelErrorsToAdd)
+ {
+ if (cache.TryGetValue(identifier, out lazyPoco))
+ {
+ var modelError = (ModelError)lazyPoco.Value;
+ poco.AssociatedModelErrors.Add(modelError);
+ }
+ }
+
+ var extensionModelErrorsToAdd = dto.ExtensionModelErrors.Except(poco.ExtensionModelErrors.Select(x => x.Id));
+ foreach (var identifier in extensionModelErrorsToAdd)
+ {
+ if (cache.TryGetValue(identifier, out lazyPoco))
+ {
+ var modelError = (ModelError)lazyPoco.Value;
+ poco.ExtensionModelErrors.Add(modelError);
+ }
+ }
+
+ var extensionsToAdd = dto.Extensions.Except(poco.Extensions.Select(x => x.Id));
+ foreach (var identifier in extensionsToAdd)
+ {
+ if (cache.TryGetValue(identifier, out lazyPoco))
+ {
+ var extension = (Extension)lazyPoco.Value;
+ poco.Extensions.Add(extension);
+ }
+ }
+
+ var roleSequenceToAdd = dto.RoleSequence.Except(poco.RoleSequence.Select(x => x.Id));
+ foreach (var identifier in roleSequenceToAdd)
+ {
+ if (cache.TryGetValue(identifier, out lazyPoco))
+ {
+ var constraintRoleSequenceWithJoinAndId = (ConstraintRoleSequenceWithJoinAndId)lazyPoco.Value;
+ poco.RoleSequence.Add(constraintRoleSequenceWithJoinAndId);
+ }
+ }
+ }
+ }
+}
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
diff --git a/Kalliope.Dal/AutoGenExtension/JoinRuleExtensions.cs b/Kalliope.Dal/AutoGenExtension/JoinRuleExtensions.cs
new file mode 100644
index 00000000..fccb5f3f
--- /dev/null
+++ b/Kalliope.Dal/AutoGenExtension/JoinRuleExtensions.cs
@@ -0,0 +1,138 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2023 RHEA System S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
+
+namespace Kalliope.Dal
+{
+ using System;
+ using System.Collections.Concurrent;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ using Kalliope.Absorption;
+ using Kalliope.Common;
+ using Kalliope.Core;
+ using Kalliope.CustomProperties;
+ using Kalliope.Diagrams;
+
+ ///
+ /// A static class that provides extension methods for the class
+ ///
+ public static class JoinRuleExtensions
+ {
+ ///
+ /// Updates the value properties of the by setting the value equal to that of the dto
+ /// Removes deleted objects from the reference properties and returns the unique identifiers
+ /// of the objects that have been removed from properties
+ ///
+ ///
+ /// The that is to be updated
+ ///
+ ///
+ /// The DTO that is used to update the with
+ ///
+ ///
+ /// The unique identifiers of the objects that have been removed from properties
+ ///
+ ///
+ /// Thrown when the or is null
+ ///
+ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties(this Kalliope.Core.JoinRule poco, Kalliope.DTO.JoinRule dto)
+ {
+ if (poco == null)
+ {
+ throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null");
+ }
+
+ if (dto == null)
+ {
+ throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null");
+ }
+
+ var identifiersOfObjectsToDelete = new List();
+
+ if (poco.JoinPath != null && poco.JoinPath.Id != dto.JoinPath)
+ {
+ identifiersOfObjectsToDelete.Add(poco.JoinPath.Id);
+ poco.JoinPath = null;
+ }
+
+ if (poco.JoinPathRequiredError != null && poco.JoinPathRequiredError.Id != dto.JoinPathRequiredError)
+ {
+ identifiersOfObjectsToDelete.Add(poco.JoinPathRequiredError.Id);
+ poco.JoinPathRequiredError = null;
+ }
+
+ return identifiersOfObjectsToDelete;
+ }
+
+ ///
+ /// Updates the Reference properties of the using the data (identifiers) encapsulated in the DTO
+ /// and the provided cache to find the referenced object.
+ ///
+ ///
+ /// The that is to be updated
+ ///
+ ///
+ /// The DTO that is used to update the with
+ ///
+ ///
+ /// The that contains the
+ /// s that are know and cached.
+ ///
+ ///
+ public static void UpdateReferenceProperties(this Kalliope.Core.JoinRule poco, Kalliope.DTO.JoinRule dto, ConcurrentDictionary> cache)
+ {
+ if (poco == null)
+ {
+ throw new ArgumentNullException(nameof(poco), $"the {nameof(poco)} may not be null");
+ }
+
+ if (dto == null)
+ {
+ throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null");
+ }
+
+ if (cache == null)
+ {
+ throw new ArgumentNullException(nameof(cache), $"the {nameof(cache)} may not be null");
+ }
+
+ Lazy lazyPoco;
+
+ if (poco.JoinPath == null && !string.IsNullOrEmpty(dto.JoinPath) && cache.TryGetValue(dto.JoinPath, out lazyPoco))
+ {
+ poco.JoinPath = (ConstraintRoleSequenceJoinPath)lazyPoco.Value;
+ }
+
+ if (poco.JoinPathRequiredError == null && !string.IsNullOrEmpty(dto.JoinPathRequiredError) && cache.TryGetValue(dto.JoinPathRequiredError, out lazyPoco))
+ {
+ poco.JoinPathRequiredError = (JoinPathRequiredError)lazyPoco.Value;
+ }
+ }
+ }
+}
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
diff --git a/Kalliope.Dal/AutoGenModelThing/ModelThingExtensions.cs b/Kalliope.Dal/AutoGenModelThing/ModelThingExtensions.cs
index a0758e23..8d85d8b1 100644
--- a/Kalliope.Dal/AutoGenModelThing/ModelThingExtensions.cs
+++ b/Kalliope.Dal/AutoGenModelThing/ModelThingExtensions.cs
@@ -140,9 +140,12 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties
case "ConstraintRoleSequenceJoinPathRequiresProjectionError":
var constraintRoleSequenceJoinPathRequiresProjectionError = poco as Kalliope.Core.ConstraintRoleSequenceJoinPathRequiresProjectionError;
return constraintRoleSequenceJoinPathRequiresProjectionError.UpdateValueAndRemoveDeletedReferenceProperties((Kalliope.DTO.ConstraintRoleSequenceJoinPathRequiresProjectionError)dto);
- case "ConstraintRoleSequenceWithJoin":
- var constraintRoleSequenceWithJoin = poco as Kalliope.Core.ConstraintRoleSequenceWithJoin;
- return constraintRoleSequenceWithJoin.UpdateValueAndRemoveDeletedReferenceProperties((Kalliope.DTO.ConstraintRoleSequenceWithJoin)dto);
+ case "ConstraintRoleSequences":
+ var constraintRoleSequences = poco as Kalliope.Core.ConstraintRoleSequences;
+ return constraintRoleSequences.UpdateValueAndRemoveDeletedReferenceProperties((Kalliope.DTO.ConstraintRoleSequences)dto);
+ case "ConstraintRoleSequenceWithJoinAndId":
+ var constraintRoleSequenceWithJoinAndId = poco as Kalliope.Core.ConstraintRoleSequenceWithJoinAndId;
+ return constraintRoleSequenceWithJoinAndId.UpdateValueAndRemoveDeletedReferenceProperties((Kalliope.DTO.ConstraintRoleSequenceWithJoinAndId)dto);
case "CorrelatedPathRoleRequiresCompatibleRolePlayerError":
var correlatedPathRoleRequiresCompatibleRolePlayerError = poco as Kalliope.Core.CorrelatedPathRoleRequiresCompatibleRolePlayerError;
return correlatedPathRoleRequiresCompatibleRolePlayerError.UpdateValueAndRemoveDeletedReferenceProperties((Kalliope.DTO.CorrelatedPathRoleRequiresCompatibleRolePlayerError)dto);
@@ -377,6 +380,9 @@ public static IEnumerable UpdateValueAndRemoveDeletedReferenceProperties
case "JoinPathRequiresProjectionError":
var joinPathRequiresProjectionError = poco as Kalliope.Core.JoinPathRequiresProjectionError;
return joinPathRequiresProjectionError.UpdateValueAndRemoveDeletedReferenceProperties((Kalliope.DTO.JoinPathRequiresProjectionError)dto);
+ case "JoinRule":
+ var joinRule = poco as Kalliope.Core.JoinRule;
+ return joinRule.UpdateValueAndRemoveDeletedReferenceProperties((Kalliope.DTO.JoinRule)dto);
case "LargeLengthRawDataDataType":
var largeLengthRawDataDataType = poco as Kalliope.Core.LargeLengthRawDataDataType;
return largeLengthRawDataDataType.UpdateValueAndRemoveDeletedReferenceProperties((Kalliope.DTO.LargeLengthRawDataDataType)dto);
@@ -895,9 +901,13 @@ public static void UpdateReferenceProperties(this Kalliope.Core.ModelThing poco,
var constraintRoleSequenceJoinPathRequiresProjectionError = poco as Kalliope.Core.ConstraintRoleSequenceJoinPathRequiresProjectionError;
constraintRoleSequenceJoinPathRequiresProjectionError.UpdateReferenceProperties((Kalliope.DTO.ConstraintRoleSequenceJoinPathRequiresProjectionError)dto, cache);
break;
- case "ConstraintRoleSequenceWithJoin":
- var constraintRoleSequenceWithJoin = poco as Kalliope.Core.ConstraintRoleSequenceWithJoin;
- constraintRoleSequenceWithJoin.UpdateReferenceProperties((Kalliope.DTO.ConstraintRoleSequenceWithJoin)dto, cache);
+ case "ConstraintRoleSequences":
+ var constraintRoleSequences = poco as Kalliope.Core.ConstraintRoleSequences;
+ constraintRoleSequences.UpdateReferenceProperties((Kalliope.DTO.ConstraintRoleSequences)dto, cache);
+ break;
+ case "ConstraintRoleSequenceWithJoinAndId":
+ var constraintRoleSequenceWithJoinAndId = poco as Kalliope.Core.ConstraintRoleSequenceWithJoinAndId;
+ constraintRoleSequenceWithJoinAndId.UpdateReferenceProperties((Kalliope.DTO.ConstraintRoleSequenceWithJoinAndId)dto, cache);
break;
case "CorrelatedPathRoleRequiresCompatibleRolePlayerError":
var correlatedPathRoleRequiresCompatibleRolePlayerError = poco as Kalliope.Core.CorrelatedPathRoleRequiresCompatibleRolePlayerError;
@@ -1211,6 +1221,10 @@ public static void UpdateReferenceProperties(this Kalliope.Core.ModelThing poco,
var joinPathRequiresProjectionError = poco as Kalliope.Core.JoinPathRequiresProjectionError;
joinPathRequiresProjectionError.UpdateReferenceProperties((Kalliope.DTO.JoinPathRequiresProjectionError)dto, cache);
break;
+ case "JoinRule":
+ var joinRule = poco as Kalliope.Core.JoinRule;
+ joinRule.UpdateReferenceProperties((Kalliope.DTO.JoinRule)dto, cache);
+ break;
case "LargeLengthRawDataDataType":
var largeLengthRawDataDataType = poco as Kalliope.Core.LargeLengthRawDataDataType;
largeLengthRawDataDataType.UpdateReferenceProperties((Kalliope.DTO.LargeLengthRawDataDataType)dto, cache);
diff --git a/Kalliope.Dal/AutoGenModelThingFactories/ConstraintRoleSequenceWithJoinAndIdFactory.cs b/Kalliope.Dal/AutoGenModelThingFactories/ConstraintRoleSequenceWithJoinAndIdFactory.cs
new file mode 100644
index 00000000..67021c1b
--- /dev/null
+++ b/Kalliope.Dal/AutoGenModelThingFactories/ConstraintRoleSequenceWithJoinAndIdFactory.cs
@@ -0,0 +1,71 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2023 RHEA System S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
+
+namespace Kalliope.Dal
+{
+ using System;
+
+ using Kalliope.Core;
+ using Kalliope.Diagrams;
+
+ ///
+ /// The purpose of the is to create a new instance of a
+ /// based on a
+ ///
+ public class ConstraintRoleSequenceWithJoinAndIdFactory
+ {
+ ///
+ /// Creates an instance of the and sets the value properties
+ /// based on the DTO
+ ///
+ ///
+ /// The instance of the
+ ///
+ ///
+ /// an instance of
+ ///
+ ///
+ /// thrown when is null
+ ///
+ public Kalliope.Core.ConstraintRoleSequenceWithJoinAndId Create(Kalliope.DTO.ConstraintRoleSequenceWithJoinAndId dto)
+ {
+ if (dto == null)
+ {
+ throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null");
+ }
+
+ var constraintRoleSequenceWithJoinAndId = new Kalliope.Core.ConstraintRoleSequenceWithJoinAndId()
+ {
+ Id = dto.Id,
+ Name = dto.Name,
+ };
+
+ return constraintRoleSequenceWithJoinAndId;
+ }
+ }
+}
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
diff --git a/Kalliope.Dal/AutoGenModelThingFactories/ConstraintRoleSequencesFactory.cs b/Kalliope.Dal/AutoGenModelThingFactories/ConstraintRoleSequencesFactory.cs
new file mode 100644
index 00000000..fb4a0df8
--- /dev/null
+++ b/Kalliope.Dal/AutoGenModelThingFactories/ConstraintRoleSequencesFactory.cs
@@ -0,0 +1,71 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2023 RHEA System S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
+
+namespace Kalliope.Dal
+{
+ using System;
+
+ using Kalliope.Core;
+ using Kalliope.Diagrams;
+
+ ///
+ /// The purpose of the is to create a new instance of a
+ /// based on a
+ ///
+ public class ConstraintRoleSequencesFactory
+ {
+ ///
+ /// Creates an instance of the and sets the value properties
+ /// based on the DTO
+ ///
+ ///
+ /// The instance of the
+ ///
+ ///
+ /// an instance of
+ ///
+ ///
+ /// thrown when is null
+ ///
+ public Kalliope.Core.ConstraintRoleSequences Create(Kalliope.DTO.ConstraintRoleSequences dto)
+ {
+ if (dto == null)
+ {
+ throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null");
+ }
+
+ var constraintRoleSequences = new Kalliope.Core.ConstraintRoleSequences()
+ {
+ Id = dto.Id,
+ Name = dto.Name,
+ };
+
+ return constraintRoleSequences;
+ }
+ }
+}
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
diff --git a/Kalliope.Dal/AutoGenModelThingFactories/JoinRuleFactory.cs b/Kalliope.Dal/AutoGenModelThingFactories/JoinRuleFactory.cs
new file mode 100644
index 00000000..9aebf034
--- /dev/null
+++ b/Kalliope.Dal/AutoGenModelThingFactories/JoinRuleFactory.cs
@@ -0,0 +1,70 @@
+// -------------------------------------------------------------------------------------------------
+//
+//
+// Copyright 2022-2023 RHEA System S.A.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+//
+//
+// ------------------------------------------------------------------------------------------------
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
+
+namespace Kalliope.Dal
+{
+ using System;
+
+ using Kalliope.Core;
+ using Kalliope.Diagrams;
+
+ ///
+ /// The purpose of the is to create a new instance of a
+ /// based on a
+ ///
+ public class JoinRuleFactory
+ {
+ ///
+ /// Creates an instance of the and sets the value properties
+ /// based on the DTO
+ ///
+ ///
+ /// The instance of the
+ ///
+ ///
+ /// an instance of
+ ///
+ ///
+ /// thrown when is null
+ ///
+ public Kalliope.Core.JoinRule Create(Kalliope.DTO.JoinRule dto)
+ {
+ if (dto == null)
+ {
+ throw new ArgumentNullException(nameof(dto), $"the {nameof(dto)} may not be null");
+ }
+
+ var joinRule = new Kalliope.Core.JoinRule()
+ {
+ Id = dto.Id,
+ };
+
+ return joinRule;
+ }
+ }
+}
+
+// ------------------------------------------------------------------------------------------------
+// --------THIS IS AN AUTOMATICALLY GENERATED FILE. ANY MANUAL CHANGES WILL BE OVERWRITTEN!--------
+// ------------------------------------------------------------------------------------------------
diff --git a/Kalliope.Dal/AutoGenModelThingFactory/ModelThingFactory.cs b/Kalliope.Dal/AutoGenModelThingFactory/ModelThingFactory.cs
index 3ecc4a6b..4f72b42b 100644
--- a/Kalliope.Dal/AutoGenModelThingFactory/ModelThingFactory.cs
+++ b/Kalliope.Dal/AutoGenModelThingFactory/ModelThingFactory.cs
@@ -151,10 +151,14 @@ public Kalliope.Core.ModelThing Create(Kalliope.DTO.ModelThing dto)
var constraintRoleSequenceJoinPathRequiresProjectionError = dto as Kalliope.DTO.ConstraintRoleSequenceJoinPathRequiresProjectionError;
var constraintRoleSequenceJoinPathRequiresProjectionErrorFactory = new ConstraintRoleSequenceJoinPathRequiresProjectionErrorFactory();
return constraintRoleSequenceJoinPathRequiresProjectionErrorFactory.Create(constraintRoleSequenceJoinPathRequiresProjectionError);
- case "ConstraintRoleSequenceWithJoin":
- var constraintRoleSequenceWithJoin = dto as Kalliope.DTO.ConstraintRoleSequenceWithJoin;
- var constraintRoleSequenceWithJoinFactory = new ConstraintRoleSequenceWithJoinFactory();
- return constraintRoleSequenceWithJoinFactory.Create(constraintRoleSequenceWithJoin);
+ case "ConstraintRoleSequences":
+ var constraintRoleSequences = dto as Kalliope.DTO.ConstraintRoleSequences;
+ var constraintRoleSequencesFactory = new ConstraintRoleSequencesFactory();
+ return constraintRoleSequencesFactory.Create(constraintRoleSequences);
+ case "ConstraintRoleSequenceWithJoinAndId":
+ var constraintRoleSequenceWithJoinAndId = dto as Kalliope.DTO.ConstraintRoleSequenceWithJoinAndId;
+ var constraintRoleSequenceWithJoinAndIdFactory = new ConstraintRoleSequenceWithJoinAndIdFactory();
+ return constraintRoleSequenceWithJoinAndIdFactory.Create(constraintRoleSequenceWithJoinAndId);
case "CorrelatedPathRoleRequiresCompatibleRolePlayerError":
var correlatedPathRoleRequiresCompatibleRolePlayerError = dto as Kalliope.DTO.CorrelatedPathRoleRequiresCompatibleRolePlayerError;
var correlatedPathRoleRequiresCompatibleRolePlayerErrorFactory = new CorrelatedPathRoleRequiresCompatibleRolePlayerErrorFactory();
@@ -467,6 +471,10 @@ public Kalliope.Core.ModelThing Create(Kalliope.DTO.ModelThing dto)
var joinPathRequiresProjectionError = dto as Kalliope.DTO.JoinPathRequiresProjectionError;
var joinPathRequiresProjectionErrorFactory = new JoinPathRequiresProjectionErrorFactory();
return joinPathRequiresProjectionErrorFactory.Create(joinPathRequiresProjectionError);
+ case "JoinRule":
+ var joinRule = dto as Kalliope.DTO.JoinRule;
+ var joinRuleFactory = new JoinRuleFactory();
+ return joinRuleFactory.Create(joinRule);
case "LargeLengthRawDataDataType":
var largeLengthRawDataDataType = dto as Kalliope.DTO.LargeLengthRawDataDataType;
var largeLengthRawDataDataTypeFactory = new LargeLengthRawDataDataTypeFactory();
diff --git a/Kalliope.Xml/Readers/Core/Constraints/ConstraintXmlReader.cs b/Kalliope.Xml/Readers/Core/Constraints/ConstraintXmlReader.cs
index a7e0c14b..5c4b8938 100644
--- a/Kalliope.Xml/Readers/Core/Constraints/ConstraintXmlReader.cs
+++ b/Kalliope.Xml/Readers/Core/Constraints/ConstraintXmlReader.cs
@@ -83,14 +83,52 @@ public void ReadXml(Constraint constraint, XmlReader reader, List mo
}
break;
- case "RoleSequences":
+ case "RoleSequence":
using (var roleSequencesSubtree = reader.ReadSubtree())
{
roleSequencesSubtree.MoveToContent();
- this.ReadRoleSequences(constraint, roleSequencesSubtree, modelThings);
+ this.ReadRoleSequence(constraint, roleSequencesSubtree, modelThings);
}
break;
-
+
+
+ case "PreferredIdentifierFor":
+
+ using (var preferredIdentifierForSubtree = reader.ReadSubtree())
+ {
+ preferredIdentifierForSubtree.MoveToContent();
+ this.ReadPreferredIdentifierFor(constraint, preferredIdentifierForSubtree, modelThings);
+ }
+ break;
+
+ case "ImpliedByObjectType":
+
+ using (var impliedByObjectTypeSubtree = reader.ReadSubtree())
+ {
+ impliedByObjectTypeSubtree.MoveToContent();
+ this.ReadImpliedByObjectType(constraint, impliedByObjectTypeSubtree, modelThings);
+ }
+ break;
+
+ case "InherentForObjectType":
+
+ using (var inherentForObjectTypeSubtree = reader.ReadSubtree())
+ {
+ inherentForObjectTypeSubtree.MoveToContent();
+ this.ReadInherentForObjectType(constraint, inherentForObjectTypeSubtree, modelThings);
+ }
+ break;
+
+ case "ExclusiveOrExclusionConstraint":
+
+ using (var exclusiveOrExclusionConstraintSubtree = reader.ReadSubtree())
+ {
+ exclusiveOrExclusionConstraintSubtree.MoveToContent();
+ this.ReadExclusiveOrExclusionConstraint(constraint, exclusiveOrExclusionConstraintSubtree, modelThings);
+ }
+ break;
+
+
default:
throw new NotSupportedException($"{localName} not yet supported");
}
@@ -107,24 +145,95 @@ public void ReadXml(Constraint constraint, XmlReader reader, List mo
///
/// an instance of used to read the .orm file
///
- protected virtual void ReadRoleSequences(Constraint constraint, XmlReader reader, List modelThings)
+ ///
+ /// a list of s to which the deserialized items are added
+ ///
+ protected virtual void ReadRoleSequence(Constraint constraint, XmlReader reader, List modelThings)
{
throw new NotSupportedException($"RoleSequences is not allowed on the {nameof(Constraint)} abstract baseclass");
}
///
- /// reads the contained s
- ///
- ///
- /// The container of the
- ///
- ///
- /// an instance of used to read the .orm file
- ///
- ///
- /// a list of s to which the deserialized items are added
- ///
- private void ReadDefinitions(Constraint constraint, XmlReader reader, List modelThings)
+ /// Reads PreferredIdentifierFor from the .orm file
+ ///
+ ///
+ /// The that contains the s
+ ///
+ ///
+ /// an instance of used to read the .orm file
+ ///
+ ///
+ /// a list of s to which the deserialized items are added
+ ///
+ protected virtual void ReadPreferredIdentifierFor(Constraint constraint, XmlReader reader, List modelThings)
+ {
+ throw new NotSupportedException($"PreferredIdentifierFor is not allowed on the {nameof(Constraint)} abstract baseclass");
+ }
+
+ ///
+ /// Reads ImpliedByObjectType from the .orm file
+ ///
+ ///
+ /// The that contains the s
+ ///
+ ///
+ /// an instance of used to read the .orm file
+ ///
+ ///
+ /// a list of s to which the deserialized items are added
+ ///
+ protected virtual void ReadImpliedByObjectType(Constraint constraint, XmlReader reader, List modelThings)
+ {
+ throw new NotSupportedException($"ImpliedByObjectType is not allowed on the {nameof(Constraint)} abstract baseclass");
+ }
+
+ ///
+ /// Reads InherentForObjectType from the .orm file
+ ///
+ ///
+ /// The that contains the s
+ ///
+ ///
+ /// an instance of used to read the .orm file
+ ///
+ ///
+ /// a list of s to which the deserialized items are added
+ ///
+ protected virtual void ReadInherentForObjectType(Constraint constraint, XmlReader reader, List modelThings)
+ {
+ throw new NotSupportedException($"InherentForObjectType is not allowed on the {nameof(Constraint)} abstract baseclass");
+ }
+
+ ///
+ /// Reads ExclusiveOrExclusionConstraint from the .orm file
+ ///
+ ///
+ /// The that contains the s
+ ///
+ ///
+ /// an instance of used to read the .orm file
+ ///
+ ///
+ /// a list of s to which the deserialized items are added
+ ///
+ protected virtual void ReadExclusiveOrExclusionConstraint(Constraint constraint, XmlReader reader, List modelThings)
+ {
+ throw new NotSupportedException($"ExclusiveOrExclusionConstraint is not allowed on the {nameof(Constraint)} abstract baseclass");
+ }
+
+ ///
+ /// reads the contained s
+ ///
+ ///
+ /// The container of the
+ ///
+ ///
+ /// an instance of used to read the .orm file
+ ///
+ ///
+ /// a list of s to which the deserialized items are added
+ ///
+ private void ReadDefinitions(Constraint constraint, XmlReader reader, List modelThings)
{
while (reader.Read())
{
diff --git a/Kalliope.Xml/Readers/Core/Constraints/MandatoryConstraintXmlReader.cs b/Kalliope.Xml/Readers/Core/Constraints/MandatoryConstraintXmlReader.cs
index 81455123..a5c92a97 100644
--- a/Kalliope.Xml/Readers/Core/Constraints/MandatoryConstraintXmlReader.cs
+++ b/Kalliope.Xml/Readers/Core/Constraints/MandatoryConstraintXmlReader.cs
@@ -47,8 +47,6 @@ public class MandatoryConstraintXmlReader : SetConstraintXmlReader
///
public void ReadXml(MandatoryConstraint mandatoryConstraint, XmlReader reader, List modelThings)
{
- base.ReadXml(mandatoryConstraint, reader, modelThings);
-
var isSimple = reader.GetAttribute("IsSimple");
if (isSimple != null)
{
@@ -70,51 +68,70 @@ public void ReadXml(MandatoryConstraint mandatoryConstraint, XmlReader reader, L
}
}
- using (var constraintSubtree = reader.ReadSubtree())
+ base.ReadXml(mandatoryConstraint, reader, modelThings);
+ }
+
+
+ ///
+ /// Reads ImpliedByObjectType from the .orm file
+ ///
+ ///
+ /// The that contains the s
+ ///
+ ///
+ /// an instance of used to read the .orm file
+ ///
+ ///
+ /// a list of s to which the deserialized items are added
+ ///
+ protected override void ReadImpliedByObjectType(Constraint constraint, XmlReader reader, List modelThings)
+ {
+ var impliedByObjectType = reader.GetAttribute("ref");
+ if (!string.IsNullOrEmpty(impliedByObjectType))
{
- constraintSubtree.MoveToContent();
+ ((MandatoryConstraint)constraint).ImpliedByObjectType = impliedByObjectType;
+ }
+ }
- while (constraintSubtree.Read())
- {
- if (constraintSubtree.MoveToContent() == XmlNodeType.Element)
- {
- var localName = reader.LocalName;
+ ///
+ /// Reads InherentForObjectType from the .orm file
+ ///
+ ///
+ /// The that contains the s
+ ///
+ ///
+ /// an instance of used to read the .orm file
+ ///
+ ///
+ /// a list of s to which the deserialized items are added
+ ///
+ protected override void ReadInherentForObjectType(Constraint constraint, XmlReader reader, List modelThings)
+ {
+ var inherentForObjectType = reader.GetAttribute("ref");
+ if (!string.IsNullOrEmpty(inherentForObjectType))
+ {
+ ((MandatoryConstraint)constraint).InherentForObjectType = inherentForObjectType;
+ }
+ }
- switch (localName)
- {
- case "RoleSequence":
- using (var roleSequenceSubtree = constraintSubtree.ReadSubtree())
- {
- roleSequenceSubtree.MoveToContent();
- this.ReadRoleSequences(mandatoryConstraint, roleSequenceSubtree, modelThings);
- }
- break;
- case "ImpliedByObjectType":
- var impliedByObjectType = reader.GetAttribute("ref");
- if (!string.IsNullOrEmpty(impliedByObjectType) )
- {
- mandatoryConstraint.ImpliedByObjectType = impliedByObjectType;
- }
- break;
- case "InherentForObjectType":
- var inherentForObjectType = reader.GetAttribute("ref");
- if (!string.IsNullOrEmpty(inherentForObjectType))
- {
- mandatoryConstraint.InherentForObjectType = inherentForObjectType;
- }
- break;
- case "ExclusiveOrExclusionConstraint":
- var exclusiveOrExclusionConstraint = reader.GetAttribute("ref");
- if (!string.IsNullOrEmpty(exclusiveOrExclusionConstraint))
- {
- mandatoryConstraint.ExclusiveOrExclusionConstraint = exclusiveOrExclusionConstraint;
- }
- break;
- default:
- throw new NotSupportedException($"{localName} not yet supported");
- }
- }
- }
+ ///
+ /// Reads ExclusiveOrExclusionConstraint from the .orm file
+ ///
+ ///
+ /// The that contains the s
+ ///
+ ///
+ /// an instance of used to read the .orm file
+ ///
+ ///
+ /// a list of s to which the deserialized items are added
+ ///
+ protected override void ReadExclusiveOrExclusionConstraint(Constraint constraint, XmlReader reader, List modelThings)
+ {
+ var exclusiveOrExclusionConstraint = reader.GetAttribute("ref");
+ if (!string.IsNullOrEmpty(exclusiveOrExclusionConstraint))
+ {
+ ((MandatoryConstraint)constraint).ExclusiveOrExclusionConstraint = exclusiveOrExclusionConstraint;
}
}
}
diff --git a/Kalliope.Xml/Readers/Core/Constraints/SetConstraintXmlReader.cs b/Kalliope.Xml/Readers/Core/Constraints/SetConstraintXmlReader.cs
index 345c8ae0..b9ec60b5 100644
--- a/Kalliope.Xml/Readers/Core/Constraints/SetConstraintXmlReader.cs
+++ b/Kalliope.Xml/Readers/Core/Constraints/SetConstraintXmlReader.cs
@@ -58,7 +58,10 @@ public void ReadXml(SetConstraint setConstraint, XmlReader reader, List
/// an instance of used to read the .orm file
///
- protected override void ReadRoleSequences(Constraint constraint, XmlReader reader, List modelThings)
+ ///
+ /// a list of s to which the deserialized items are added
+ ///
+ protected override void ReadRoleSequence(Constraint constraint, XmlReader reader, List modelThings)
{
while (reader.Read())
{
@@ -68,18 +71,29 @@ protected override void ReadRoleSequences(Constraint constraint, XmlReader reade
switch (localName)
{
- case "RoleSequence":
+ case "Role":
using (var roleSequenceSubTree = reader.ReadSubtree())
{
roleSequenceSubTree.MoveToContent();
- var roleSequence = new ConstraintRoleSequence();
- var roleSequenceXmlReader = new ConstraintRoleSequenceXmlReader();
- roleSequenceXmlReader.ReadXml(roleSequence, roleSequenceSubTree, modelThings);
- roleSequence.Container = constraint.Id;
- ((SetConstraint)constraint).RoleSequences.Add(roleSequence.Id);
+ var roleRef = reader.GetAttribute("ref");
+ ((SetConstraint)constraint).RoleSequences.Add(roleRef);
}
break;
+
+ case "JoinRule":
+ //ToDo: Implement JoinRuleXmlReader
+
+ using (var joinRuleSubTree = reader.ReadSubtree())
+ {
+ joinRuleSubTree.MoveToContent();
+ //var roleRef = reader.GetAttribute("ref");
+ //((SetConstraint)constraint).RoleSequences.Add(roleRef);
+ }
+
+ break;
+
+
default:
throw new NotSupportedException($"{localName} not yet supported");
}
diff --git a/Kalliope.Xml/Readers/Core/Constraints/UniquenessConstraintXmlReader.cs b/Kalliope.Xml/Readers/Core/Constraints/UniquenessConstraintXmlReader.cs
index b49f83e5..7989f559 100644
--- a/Kalliope.Xml/Readers/Core/Constraints/UniquenessConstraintXmlReader.cs
+++ b/Kalliope.Xml/Readers/Core/Constraints/UniquenessConstraintXmlReader.cs
@@ -46,8 +46,6 @@ public class UniquenessConstraintXmlReader : SetConstraintXmlReader
///
public void ReadXml(UniquenessConstraint uniquenessConstraint, XmlReader reader, List modelThings)
{
- base.ReadXml(uniquenessConstraint, reader, modelThings);
-
var isPreferred = reader.GetAttribute("IsPreferred");
if (isPreferred != null)
{
@@ -60,38 +58,26 @@ public void ReadXml(UniquenessConstraint uniquenessConstraint, XmlReader reader,
uniquenessConstraint.IsInternal = XmlConvert.ToBoolean(isInternal);
}
- using (var constraintSubtree = reader.ReadSubtree())
- {
- constraintSubtree.MoveToContent();
-
- while (constraintSubtree.Read())
- {
- if (constraintSubtree.MoveToContent() == XmlNodeType.Element)
- {
- var localName = reader.LocalName;
+ base.ReadXml(uniquenessConstraint, reader, modelThings);
+ }
- switch (localName)
- {
- case "RoleSequence":
- using (var roleSequenceSubtree = constraintSubtree.ReadSubtree())
- {
- roleSequenceSubtree.MoveToContent();
- this.ReadRoleSequences(uniquenessConstraint, roleSequenceSubtree, modelThings);
- }
- break;
- case "PreferredIdentifierFor":
- var preferredIdentifierFor = reader.GetAttribute("ref");
- if (!string.IsNullOrEmpty(preferredIdentifierFor))
- {
- uniquenessConstraint.PreferredIdentifierFor = preferredIdentifierFor;
- }
- break;
- default:
- throw new NotSupportedException($"{localName} not yet supported");
- }
- }
- }
- }
+ ///
+ /// Reads PreferredIdentifierFor from the .orm file
+ ///
+ ///
+ /// The that contains the s
+ ///
+ ///
+ /// an instance of used to read the .orm file
+ ///
+ ///
+ /// a list of s to which the deserialized items are added
+ ///
+ protected override void ReadPreferredIdentifierFor(Constraint constraint, XmlReader reader,
+ List modelThings)
+ {
+ var preferredIdentifierFor = reader.GetAttribute("ref");
+ ((UniquenessConstraint)constraint).PreferredIdentifierFor = preferredIdentifierFor;
}
}
}
diff --git a/Kalliope.Xml/Resources/ORM2Core.designer.cs b/Kalliope.Xml/Resources/ORM2Core.designer.cs
new file mode 100644
index 00000000..42bc8cbd
--- /dev/null
+++ b/Kalliope.Xml/Resources/ORM2Core.designer.cs
@@ -0,0 +1,11203 @@
+// ------------------------------------------------------------------------------
+//
+// Generated by Xsd2Code. Version 3.4.1.33667 Microsoft Reciprocal License (Ms-RL)
+// Kalliope.XmlListCSharpFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseFalseNet40SerializeDeserializeSaveToFileLoadFromFileFalseFalseFalseFalseFalseFalseDefaultUTF8FalseTrue
+//
+// ------------------------------------------------------------------------------
+namespace Kalliope.Xml
+{
+ using System;
+ using System.Diagnostics;
+ using System.Xml.Serialization;
+ using System.Collections;
+ using System.Xml.Schema;
+ using System.ComponentModel;
+ using System.Collections.Generic;
+
+
+ public partial class ORMModelType
+ {
+
+ private DefinitionsType definitionsField;
+
+ private NotesType notesField;
+
+ private List objectsField;
+
+ private List