Issue with Generate from XML

Issue with Generate from XML

Old forum URL: forums.lhotka.net/forums/t/1776.aspx


wjcomeaux posted on Thursday, November 16, 2006

The below object definition throws the error "Error Rendering BuildingECL: Parent is required.
- C:\Test\Stuller.Requests.BusinessObjects\\Generated\BuildingECL.Base.cs"

As you can see in the second to last line, I am specifying a Parent and Child relationship. The MySample.XML works just fine. What am I missing here?

<Object Access="public" Type="EditableChildList" Name="BuildingECL">

- <Properties>
- <Property Name="ID" DbColumnName="ID" Description="" Type="int" Default="" DataType="Int32" NativeType="Int32" SystemType="Int32" IsPrimaryKey="true" IsIdentity="true">
- <ValidationRules>
  <Required />
  </ValidationRules>
  </Property>
- <Property Name="Name" DbColumnName="Name" Description="" Type="string" Default="" DataType="AnsiString" NativeType="AnsiString" SystemType="AnsiString">
- <ValidationRules>
  <StringMaxLength>50</StringMaxLength>
  </ValidationRules>
  </Property>
- <Property Name="CompanyID" DbColumnName="CompanyID" Description="" Type="int" Default="" DataType="Int32" NativeType="Int32" SystemType="Int32">
  <ValidationRules />
  </Property>
  </Properties>
  <Relationship Child="BuildingEC" Parent="CompanyER" />
  </Object>

wjcomeaux replied on Thursday, November 16, 2006

I have discovered that the <ValidationRules> in an EditableChildList will cause the generator to throw the error stating that Parent is required. Not sure if tis is a bug. If you use a collection as just that and don't include any other members then you won't have any <Validation> nodes in the XML for your collections.

However, in the example provided in MySample.xml there are Property nodes defined. One could argue that there then could be need for validations. Though in a real world case, I can't think of a time when I would need private members inside of a collection class. Seems more likely that a larger container class would encapsulate the collection and the other private members.

Nevertheless, it crashes the generator. :)

Will

Copyright (c) Marimer LLC