TechTalk Genome v4.2

<Automatic> Element

Specifies that the connection in the many-to-many association is represented by an automatically generated association class.

<Member name=" property ">
<ManyToManyCollection>
<Automatic [ tableName=" table " ] [ catalog=" catalog " ] [ owner=" database-user " ] [ ChildReference=" child-reference-field-prefix " ] [ ParentReference=" parent-reference-field-prefix " ] />
</ManyToManyCollection>
</Member>
or
<Member name="property">
<ManyToManyCollection>
<Automatic [ tableName=" table " ] [ catalog=" catalog " ] [ owner=" database-user " ] >
[child-reference-element] [parent-reference-element]
</Automatic>
</ManyToManyCollection>
</Member>
catalog
A catalog (database) name in the underlying relational database system. If the catalog is not specified, the default catalog of the DataDomain is used.
database-user
A database user name. If the database-user is not specified, the default database user (dbo in Microsoft SQL Server) is used.
table
The name of a database table in which the fields of the type are stored. If the table is not specified, the short name of type is used.
child-reference-field-prefix
A string prefix used in the name of the child reference foreign keys. The field prefix is applied in the same way as for a reference mapped with <NearObjectReference> element .
parent-reference-field-prefix
A string prefix used in the name of the child reference foreign keys. The field prefix is applied in the same way as for a reference mapped with <NearObjectReference> element .
child-reference-element
This element specifies the mapping of the child reference as a <NearObjectReference> element .
parent-reference-element
This element specifies the mapping of the parent reference as a <NearObjectReference> element .

Remarks

The <Automatic> element implicitly generates an association class invisible in the object model and an association table for the database. Additional attributes can be applied to explicitly specify the structure of the association table in the database.

Examples

All details of the association class are generated automatically.

                      
  <Type name="Cage">

      <Member name="Keepers">
          <ManyToManyCollection>
              <Automatic/>
          </ManyToManyCollection>
      </Member>
      
  </Type>
              

The table name and the generated foreign key details can be specified if necessary.

                      
  <Type name="Cage">

    <Member name="Keepers">
      <ManyToManyCollection>        
      
        <Automatic tableName="CageService">
          
          <ParentReference CheckIntegrity="true">
            <Map primaryKeyName="Id" foreignKeyName="FK_CAGE_ID" />
          </ParentReference>
          
          <ChildReference CheckIntegrity="true">
            <Map primaryKeyName="Id" foreignKeyName="FK_KEEPER_ID" />
          </ChildReference>
          
        </Automatic>
        
      </ManyToManyCollection>
    </Member>
      
  </Type>
              

Requirements

Type: TechTalk.Genome.Mapping.AutomaticXmlData, TechTalk.Genome.Mapping.ManyToManyCollectionXmlData

Assembly: TechTalk.Genome.dll

Version: 4.2.11

Editions: Professional, Evaluation, Express

Database Platforms: Microsoft SQL Server 2000, Microsoft SQL Server 2005, Oracle 9i Release 2, Oracle 10g Release 2

See Also

<ManyToManyCollection> Element