Note that there are some explanatory texts on larger screens.

plurals
  1. POTrying to use Habanero Smooth to create two relationships to an XML defined class
    primarykey
    data
    text
    <h2>I am trying to use Habanero Smooth to map two relationships to a class which is defined in my ClassDefs.</h2> <h2>Habanero Smooth Class:</h2> <pre><code> [AutoMapCompulsory] [AutoMapOneToMany(ReverseRelationshipName = "TestRules")] public virtual Determinand Determinand { get { return Relationships.GetRelatedObject&lt;Determinand&gt;("Determinand"); } set { Relationships.SetRelatedObject("Determinand", value); } } [AutoMapOneToMany(ReverseRelationshipName = "RelatedTestRules")] public virtual Determinand RelatedDeterminand { get { return Relationships.GetRelatedObject&lt;Determinand&gt;("RelatedDeterminand"); } set { Relationships.SetRelatedObject("RelatedDeterminand", value); } } </code></pre> <h2>XML Class :</h2> <pre><code> &lt;class name="Determinand" assembly="" table="tbdeterminand" displayName="Determinand"&gt; &lt;property name="DeterminandID" type="Guid" readWriteRule="WriteNew" compulsory="true" /&gt; &lt;/class&gt; </code></pre> <h2>Problem</h2> <p>When I execute my test to validate that my ClassDefs are generated correctly it fails giving me the following error:</p> <h2>Test</h2> <pre><code> [Test] public void Test_ValidateClassDefs() { //---------------Set up test pack------------------- ClassDef.ClassDefs.Add(BOBroker.GetClassDefs()); //---------------Assert Precondition---------------- ClassDef.ClassDefs.ShouldNotBeEmpty(); //---------------Execute Test ---------------------- var validator = new ClassDefValidator(new DefClassFactory()); validator.ValidateClassDefs(ClassDef.ClassDefs); } </code></pre> <h2>Error</h2> <p>Habanero.Base.Exceptions.InvalidXmlDefinitionException : The relationship 'RelatedDeterminand' could not be loaded because the reverse relationship 'TestRules' defined for the related class 'Determinand' and the relationship 'RelatedDeterminand' defined for the class 'LIMS.BO.TestRule' do not have the same properties defined as the relationship keys - No matching RelProp found for RelatedDeterminandID -> DeterminandID Relationship RelatedDeterminandRelProp 1 RelatedDeterminandID - DeterminandID ReverseRelationship TestRulesRelProp 1 DeterminandID - DeterminandID at Habanero.BO.ClassDefinition.ClassDefValidator.CheckReverseRelationshipRelKeyDefProps(IRelationshipDef relationshipDef, IClassDef relatedClassDef, String reverseRelationshipName, IRelationshipDef reverseRelationshipDef, IClassDef classDef) at Habanero.BO.ClassDefinition.ClassDefValidator.ValidateReverseRelationship(IClassDef classDef, IRelationshipDef relationshipDef, IClassDef relatedClassDef) at Habanero.BO.ClassDefinition.ClassDefValidator.CheckRelationshipsForAClassDef(IDictionary`2 loadedFullPropertyLists, IClassDef classDef, ClassDefCol classDefs) at Habanero.BO.ClassDefinition.ClassDefValidator.CheckRelationships(ClassDefCol classDefs) at Habanero.BO.ClassDefinition.ClassDefValidator.ValidateClassDefs(ClassDefCol classDefCol) at LIMS.Test.BO.TestClassDefValid.Test_ValidateClassDefs() in TestClassDefValid.cs: line 37</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload