DASchemaStatement

Overview

The DASchemaStatement class represents an individual statement that defines the mapping between the Schema DataTable or Command and the Database DataTable or Stored Procedure. 
A DASchemaStatement can be based on an SQL statement, stored procedure or be an Auto-SQL statement which will generate an SQL statement dynamically and only when necessary.

Each command or table should provide one or more statements, usually one statement per connection.

You will usually not create instances of this class directly, but define data tables in Schema Modeler or access them through the Statements property of the DASchemaCommand or DASchemaDataTable classes.

Location

 

connection  retain

Represents the name of the connection.

@property (retain) NSString *connection

connectionType  retain

Defines the ConnectionType for the given statement. This property can be used to logically group connections that use similar statements. DataAbstract can use it for finding the most appropriate statement to retrieve data.

@property (retain) NSString *connectionType

generatorName  retain

Specifies the name of the id generator for given statement.

@property (retain) NSString *generatorName

initWithName:    (declared in DASchemaBaseObject)

Initializes a new instance of the class with a given name.

- (id) initWithName:(NSString *)aName

Parameters:

  • aName:

initWithXml:    (declared in DASchemaBaseObject)

Initializes a new instance of the class with a given XML string. Here, the XML string is the XML node from the Schema XML file that represents a certain schema object, for example the Schema Data Table or Schema Parameter. In most cases you will not need to invoke this method directly on the DASchemaBaseObject. This method is overridden in descendant classes (for example in the DASchemaDataTable) where it can be used for deserializing schema XML into a schema object.

- (id) initWithXml:(NSString *)anXml

Parameters:

  • anXml:

isDefault  assign

Specifies the given statement default for the table. DataAbstract can also use it for finding the most appropriate statement to retrieve the data.

@property (assign) BOOL isDefault

mappings  retain

Represents the field mapping information. Since fields in the schema can have different names and orders, mapping defines the relation between names in the schema and the database.

@property (retain) NSMutableArray *mappings

name  retain    (declared in DASchemaBaseObject)

Represents the name of the schema object. Name is a mandatory property and an exception will be raised if its value is nil or empty. Only alpha-numeric characters are allowed in the Name value.

@property (retain) NSString *name

note  retain    (declared in DASchemaBaseObject)

Description for schema object

@property (retain) NSString *note

sql  retain

Represent the SQL statement that can be used for obtaining data from the database. This property is used by DataAbstract for SQL statements. If a statement is Auto-SQL, this property will be ignored and the SQL statement will be generated automatically based on the TargetTable property.

@property (retain) NSString *sql

statementName  retain

Represents the name of the given statement. Not mandatory and can be nil.

@property (retain) NSString *statementName

statementType  assign

Specifies the type of the statement. The statementType can be Custom SQL, Stored Procedure or Auto-SQL.

@property (assign) enum DASchemaStatementType statementType

targetTable  retain

Specifies the name of the database table.

@property (retain) NSString *targetTable

 

connection  retain

Represents the name of the connection.

@property (retain) NSString *connection

connectionType  retain

Defines the ConnectionType for the given statement. This property can be used to logically group connections that use similar statements. DataAbstract can use it for finding the most appropriate statement to retrieve data.

@property (retain) NSString *connectionType

generatorName  retain

Specifies the name of the id generator for given statement.

@property (retain) NSString *generatorName

isDefault  assign

Specifies the given statement default for the table. DataAbstract can also use it for finding the most appropriate statement to retrieve the data.

@property (assign) BOOL isDefault

mappings  retain

Represents the field mapping information. Since fields in the schema can have different names and orders, mapping defines the relation between names in the schema and the database.

@property (retain) NSMutableArray *mappings

name  retain    (declared in DASchemaBaseObject)

Represents the name of the schema object. Name is a mandatory property and an exception will be raised if its value is nil or empty. Only alpha-numeric characters are allowed in the Name value.

@property (retain) NSString *name

note  retain    (declared in DASchemaBaseObject)

Description for schema object

@property (retain) NSString *note

sql  retain

Represent the SQL statement that can be used for obtaining data from the database. This property is used by DataAbstract for SQL statements. If a statement is Auto-SQL, this property will be ignored and the SQL statement will be generated automatically based on the TargetTable property.

@property (retain) NSString *sql

statementName  retain

Represents the name of the given statement. Not mandatory and can be nil.

@property (retain) NSString *statementName

statementType  assign

Specifies the type of the statement. The statementType can be Custom SQL, Stored Procedure or Auto-SQL.

@property (assign) enum DASchemaStatementType statementType

targetTable  retain

Specifies the name of the database table.

@property (retain) NSString *targetTable

 

initWithName:    (declared in DASchemaBaseObject)

Initializes a new instance of the class with a given name.

- (id) initWithName:(NSString *)aName

Parameters:

  • aName:

initWithXml:    (declared in DASchemaBaseObject)

Initializes a new instance of the class with a given XML string. Here, the XML string is the XML node from the Schema XML file that represents a certain schema object, for example the Schema Data Table or Schema Parameter. In most cases you will not need to invoke this method directly on the DASchemaBaseObject. This method is overridden in descendant classes (for example in the DASchemaDataTable) where it can be used for deserializing schema XML into a schema object.

- (id) initWithXml:(NSString *)anXml

Parameters:

  • anXml: