Show/Hide Toolbars

TMS Data Modeler Documentation

Navigation: TMS Aurelius Export > Customization Script

Adding Schema Name to Table Attribute

Scroll Prev Top Next More

Data Modeler doesn't hold schema information for each table, but when exporting to TMS Aurelius classes you can use customization script to add the schema name to the table attribute. The following script adds the schema name dbo to the table category:

 

procedure OnClassGenerated(Args: TClassGeneratedArgs);
begin
  if Args.DBTable.TableName = 'category' then    
    Args.TableAttr.AddRawArgument('''dbo''');
end;                    

 

For example, originally the class would be generated like this:

 

  [Entity]                            
  [Table('Category')]    
  [Id('FCategoryID', TIdGenerator.IdentityOrSequence)]
  TCategories = class

 

With the following script the Table attribute will be like this:

 

  [Entity]                            
  [Table('Category', 'dbo')]    
  [Id('FCategoryID', TIdGenerator.IdentityOrSequence)]
  TCategories = class