Thanks again for posting the DDL. I tried creating the table in SQL Server 2016 and importing it into a Xomega model, and the import was correct with no fieldsets defined, and just a special type for the key field (see below).
Quote:In your previous post you mention the Fieldset should only exist for composite keys or foreign keys. In this table field "biz Org id" IS a foreign key to the parent table BizOrg. But it's not in this fieldset???
What I meant to say is that fieldsets are created for composite primary keys and composite foreign keys (that consist of more than one field). The "biz org id" field uses a special logical type "biz org" in the Xomega model, which is reserved for the key field of the "biz org" object. This establishes an implicit relationship to the BizOrg table. The same is for the "biz org address type id" field.
If BizOrgAddress object is logically a part of the BizOrg domain object, then it would make more sense to move it as a sub-object of the "biz org" object, and drop the "biz org" field from it, since it would be implicitly included in the Xomega model. The DB Import generator would've imported it like this, if that foreign key had a cascade delete on it (which is not possible because of the INSTEAD OF DELETE trigger on it). But it is still pretty easy to move it manually in XML, if you would like to better design your domain model using Xomega.
Quote:Also it appears that the generator is taking ProperCased table columns and changing them to lower case with a space for each Uppercased letter. Is there a setting to remove the spaces so that LastUpdatedDate -> lastupdateddate or lastUpdatedDate? I don't think I can handle the spaces......
The DB Import keeps the original SQL names for the DB columns (e.g. <sql:column name="BizOrgAddressID"/>), but uses Xomega natural convention of lower case space-delimited strings for the logical field names. When the code is generated from this model, the C# (and other) field names will be properly capitalized with no spaces, but this convention still allows to retain the boundaries of each word in the field name, which is important to be able to properly generate readable labels on the screens, for example. Otherwise, the labels on the screens would have no spaces, and you would have to fix them for a lot of fields. That being said though, it won't be hard to add a parameter to the DB Import generator, where you'd be able to specify a different naming convention, such as with underscores, or even no separators.
Would it be okay for you if we troubleshoot this issue with the import further via an email? I will then send you some things to try, since I would really like to get to the bottom of it.
Here is the (proper) XML for the Xomega model that I got for your BizOrgAddress table.
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="http://www.xomega.net/omodel" xmlns:xfk="http://www.xomega.net/framework"
xmlns:wcf="http://www.xomega.net/wcf"
xmlns:rest="http://www.xomega.net/rest"
xmlns:ui="http://www.xomega.net/ui"
xmlns:asp="clr-namespace:System.Web.UI.WebControls;assembly=System.Web"
xmlns:sql="http://www.xomega.net/sql"
xmlns:clr="http://www.xomega.net/clr"
xmlns:edm="http://www.xomega.net/edm">
<types>
<type name="biz org address" base="integer key"/> </types>
<objects>
<object name="biz org address">
<fields>
<field name="biz org address id"
type="biz org address" key="serial" required="true">
<config>
<sql:column name="BizOrgAddressID"/>
</config>
</field>
<field name="biz org id" type="biz org" required="true">
<config>
<sql:column name="BizOrgID"/>
</config>
</field>
<field name="biz org address type id" type="biz org address type" required="true">
<config>
<sql:column name="BizOrgAddressTypeID"/>
</config>
</field>
<field name="street1" type="char string75" required="true">
<config>
<sql:column name="Street1"/>
</config>
</field>
<field name="street2" type="char string75">
<config>
<sql:column name="Street2"/>
</config>
</field>
<field name="city" type="char string50" required="true">
<config>
<sql:column name="City"/>
</config>
</field>
<field name="state region" type="char string20">
<config>
<sql:column name="StateRegion"/>
</config>
</field>
<field name="postal code" type="char string20">
<config>
<sql:column name="PostalCode"/>
</config>
</field>
<field name="country" type="char string50">
<config>
<sql:column name="Country"/>
</config>
</field>
<field name="last updated by" type="char string50" required="true">
<config>
<sql:column name="LastUpdatedBy" default="(suser_sname())"/>
</config>
</field>
<field name="last updated date" type="date time" required="true">
<config>
<sql:column name="LastUpdatedDate" default="(getdate())"/>
</config>
</field>
<field name="is deleted" type="boolean" required="true">
<config>
<sql:column name="IsDeleted" default="((0))"/>
</config>
</field>
<field name="default attention" type="char string50">
<config>
<sql:column name="DefaultAttention"/>
</config>
</field>
<field name="default phone" type="char string25">
<config>
<sql:column name="DefaultPhone"/>
</config>
</field>
<field name="default fax" type="char string25">
<config>
<sql:column name="DefaultFax"/>
</config>
</field>
</fields>
<config>
<sql:table name="BizOrgAddress"/>
</config>
</object>
</objects>
</module>