SICDatabaseMappingDescriptor Class Reference
Inherits from | NSObject |
---|---|
Conforms to | SICIDescriptor |
Declared in | SICDatabaseMappingDescriptor.h SICDatabaseMappingDescriptor.m |
Overview
Exposes methods to GET and SET Library Descriptor information as per define in DatabaseDescriptor.si.xml or LibraryDescriptor.si.xml file by application.
Example:
<database-mapping-descriptor>
<!-- General Properties Of Table And Class -->
<!-- TABLE_NAME: Mandatory Field -->
<!-- CLASS_NAME: Mandatory Field -->
<entity table_name="name_of_table" class_name="mapped_pojo_class_name">
<!-- Column Properties Required Under This Table -->
<!-- Optional Field -->
<!-- VARIABLE_NAME: Mandatory Field -->
<!-- COLUMN_NAME: Mandatory Field -->
<attribute column_name="column_name_of_table" variable_name="class_variable_name">
<!-- Mandatory Field -->
<property name="type">java_variable_data_type</property>
<!-- Optional Field (Default is false) -->
<property name="primary_key">true/false</property>
<!-- Optional Field (Default is false) -->
<property name="not_null">true/false</property>
<!-- Optional Field (Default is false) -->
<property name="unique">true/false</property>
<!-- Optional Field -->
<property name="check">condition_to_be_checked (Eg: variable_name 'condition' value; variable_name > 0)</property>
<!-- Optional Field -->
<property name="default">default_value_of_column (Eg: 0.1)</property>
</attribute>
<!-- Index Properties -->
<!-- Optional Field -->
<!-- NAME: Mandatory Field -->
<!-- UNIQUE: Optional Field (Default is false) -->
<index name="name_of_index" unique="true/false">
<column>column_name_needs_to_add</column>
</index>
<!-- Map Relationship Properties -->
<!-- Optional Field's -->
<relationships>
<!-- REFER: Mandatory Field -->
<!-- REFER_TO: Mandatory Field -->
<one-to-one refer="class_variable_name" refer_to="map_to_pojo_class_name" on_update="cascade/restrict/no_action/set_null/set_default" on_delete="cascade/restrict/no_action/set_null/set_default">
<!-- Optional Field (Default is false) -->
<property name="load">true/false</property>
</one-to-one>
<!-- REFER: Mandatory Field -->
<!-- REFER_TO: Mandatory Field -->
<one-to-many refer="class_variable_name" refer_to="map_to_pojo_class_name" on_update="cascade/restrict/no_action/set_null/set_default" on_delete="cascade/restrict/no_action/set_null/set_default">
<!-- Optional Field (Default is false) -->
<property name="load">true/false</property>
</one-to-many>
<!-- REFER: Mandatory Field -->
<!-- REFER_TO: Mandatory Field -->
<many-to-one refer="class_variable_name" refer_to="map_to_pojo_class_name" on_update="cascade/restrict/no_action/set_null/set_default" on_delete="cascade/restrict/no_action/set_null/set_default">
<!-- Optional Field (Default is false) -->
<property name="load">true/false</property>
</many-to-one>
<!-- REFER: Mandatory Field -->
<!-- REFER_TO: Mandatory Field -->
<many-to-many refer="class_variable_name" refer_to="map_to_pojo_class_name" on_update="cascade/restrict/no_action/set_null/set_default" on_delete="cascade/restrict/no_action/set_null/set_default">
<!-- Optional Field (Default is false) -->
<property name="load">true/false</property>
</many-to-many>
</relationships>
</entity>
</database-mapping-descriptor>
Other Methods
– getTableName
Get table name.
- (NSString *)getTableName
Return Value
Name of table.
Discussion
Get table name.
Declared In
SICDatabaseMappingDescriptor.h
– setTableName:
Set table name as per defined in DatabaseMappingDescriptor.si.xml file.
- (void)setTableName:(NSString *const)tableName
Parameters
tableName |
Name of table. |
---|
Discussion
Set table name as per defined in DatabaseMappingDescriptor.si.xml file.
Declared In
SICDatabaseMappingDescriptor.h
– getClassName
Get POJO class name.
- (NSString *)getClassName
Return Value
POJO class name.
Discussion
Get POJO class name.
Declared In
SICDatabaseMappingDescriptor.h
– setClassName:
Set POJO class name as per defined in DatabaseMappingDescriptor.si.xml file.
- (void)setClassName:(NSString *const)className
Parameters
className |
POJO class name. |
---|
Discussion
Set POJO class name as per defined in DatabaseMappingDescriptor.si.xml file.
Declared In
SICDatabaseMappingDescriptor.h
– containsAttributeBasedOnColumnName:
Check whether column exists based on column name.
- (BOOL)containsAttributeBasedOnColumnName:(NSString *const)columnName
Parameters
columnName |
Name of column. |
---|
Return Value
TRUE: If column exists, FALSE: If column do not exists.
Discussion
Check whether column exists based on column name.
Declared In
SICDatabaseMappingDescriptor.h
– containsAttributeBasedOnVariableName:
Check whether column exists based on variable name.
- (BOOL)containsAttributeBasedOnVariableName:(NSString *const)variableName
Parameters
variableName |
Name of variable. |
---|
Return Value
TRUE: If column exists, FALSE: If column do not exists.
Discussion
Check whether column exists based on variable name.
Declared In
SICDatabaseMappingDescriptor.h
– getAttributeBasedOnColumnName:
Get column based on column name.
- (SICAttribute *)getAttributeBasedOnColumnName:(NSString *const)columnName
Parameters
columnName |
Name of column name. |
---|
Return Value
Column object.
Discussion
Get column based on column name.
Declared In
SICDatabaseMappingDescriptor.h
– getAttributeBasedOnVariableName:
Get column based on variable name.
- (SICAttribute *)getAttributeBasedOnVariableName:(NSString *const)variableName
Parameters
variableName |
Name of variable. |
---|
Return Value
Column object.
Discussion
Get column based on variable name.
Declared In
SICDatabaseMappingDescriptor.h
– getColumnNames
Get all column names.
- (NSEnumerator *)getColumnNames
Return Value
Iterator of all column names.
Discussion
Get all column names.
Declared In
SICDatabaseMappingDescriptor.h
– getAttributes
Get all column names.
- (NSEnumerator *)getAttributes
Return Value
Iterator of all columns.
Discussion
Get all column names.
Declared In
SICDatabaseMappingDescriptor.h
– addAttribute:
Add column to DatabaseMapping object.
- (void)addAttribute:(SICAttribute *const)attribute
Parameters
attribute |
Column object. |
---|
Discussion
Add column to DatabaseMapping object.
Declared In
SICDatabaseMappingDescriptor.h
– removeAttributeBasedOnVariableName:
Remove column based on variable name.
- (void)removeAttributeBasedOnVariableName:(NSString *const)variableName
Parameters
variableName |
Name of variable. |
---|
Discussion
Remove column based on variable name.
Declared In
SICDatabaseMappingDescriptor.h
– removeAttributeBasedOnColumnName:
Remove column based on column name.
- (void)removeAttributeBasedOnColumnName:(NSString *const)columnName
Parameters
columnName |
Name of column. |
---|
Discussion
Remove column based on column name.
Declared In
SICDatabaseMappingDescriptor.h
– removeAttribute:
Remove column based on column object.
- (void)removeAttribute:(SICAttribute *const)attribute
Parameters
attribute |
Column object which need to be removed. |
---|
Discussion
Remove column based on column object.
Declared In
SICDatabaseMappingDescriptor.h
– containsIndex:
Check whether index exists based in index name.
- (BOOL)containsIndex:(NSString *const)indexName
Parameters
indexName |
Name of index. |
---|
Return Value
TRUE: If index exists, FALSE: If index do not exists.
Discussion
Check whether index exists based in index name.
Declared In
SICDatabaseMappingDescriptor.h
– getIndex:
Get index object based on index name.
- (SICIndex *)getIndex:(NSString *const)indexName
Parameters
indexName |
Name of index. |
---|
Return Value
Index object.
Discussion
Get index object based on index name.
Declared In
SICDatabaseMappingDescriptor.h
– getIndexNames
Get all index names.
- (NSEnumerator *)getIndexNames
Return Value
Iterator which contains all index names.
Discussion
Get all index names.
Declared In
SICDatabaseMappingDescriptor.h
– getIndexes
Get all indexs.
- (NSEnumerator *)getIndexes
Return Value
Iterator which contain all indexs.
Discussion
Get all indexs.
Declared In
SICDatabaseMappingDescriptor.h
– addIndex:
Add index to DatabaseMapping object.
- (void)addIndex:(SICIndex *const)index
Parameters
index |
Index object. |
---|
Discussion
Add index to DatabaseMapping object.
Declared In
SICDatabaseMappingDescriptor.h
– removeIndexBasedOnName:
Remove index object.
- (void)removeIndexBasedOnName:(NSString *const)indexName
Parameters
indexName |
Index object. |
---|
Discussion
Remove index object.
Declared In
SICDatabaseMappingDescriptor.h
– removeIndex:
Remove index object.
- (void)removeIndex:(SICIndex *const)index
Parameters
index |
Index object. |
---|
Discussion
Remove index object.
Declared In
SICDatabaseMappingDescriptor.h
– getRelationships
Get iterator of relationship objects.
- (NSEnumerator *)getRelationships
Return Value
Relationship objects.
Discussion
Get iterator of relationship objects.
Declared In
SICDatabaseMappingDescriptor.h
– getRelationshipBasedOnRefer:
Get iterator of relationship objects based on refer.
- (SICRelationship *)getRelationshipBasedOnRefer:(NSString *)refer
Parameters
refer |
Name of refer. |
---|
Return Value
Relationship object based on refer.
Discussion
Get iterator of relationship objects based on refer.
Declared In
SICDatabaseMappingDescriptor.h
– getRelationshipBasedOnReferTo:
Get relationship object based on refer to.
- (SICRelationship *)getRelationshipBasedOnReferTo:(NSString *)referTo
Parameters
referTo |
Name of refer to. |
---|
Return Value
Relationship object based on refer to.
Discussion
Get relationship object based on refer to.
Declared In
SICDatabaseMappingDescriptor.h
– getOneToOneRelationships
Get one to one relationship object.
- (NSEnumerator *)getOneToOneRelationships
Return Value
Iterator of relationship objects.
Discussion
Get one to one relationship object.
Declared In
SICDatabaseMappingDescriptor.h
– getOneToManyRelationships
Get one to many relationship object.
- (NSEnumerator *)getOneToManyRelationships
Return Value
Iterator of relationship objects.
Discussion
Get one to many relationship object.
Declared In
SICDatabaseMappingDescriptor.h
– getManyToOneRelationships
Get many to one relationship object.
- (NSEnumerator *)getManyToOneRelationships
Return Value
Iterator of relationship objects.
Discussion
Get many to one relationship object.
Declared In
SICDatabaseMappingDescriptor.h
– getManyToManyRelationships
Get many to many relationship object.
- (NSEnumerator *)getManyToManyRelationships
Return Value
Iterator of relationship objects.
Discussion
Get many to many relationship object.
Declared In
SICDatabaseMappingDescriptor.h
– addRelationship:
Add relationship object.
- (void)addRelationship:(SICRelationship *)relationship
Parameters
relationship |
Relationship object. |
---|
Discussion
Add relationship object.
Declared In
SICDatabaseMappingDescriptor.h
Protocol Methods
– getProperties
Get all the properties of descriptor
- (NSEnumerator *)getProperties
Return Value
All properties
Discussion
Get all the properties of descriptor
Declared In
SICIDescriptor.h
– getProperty:
Get the property value based on the property name
- (NSString *)getProperty:(NSString *)name
Parameters
name |
Name of the property |
---|
Return Value
Value of the property
Discussion
Get the property value based on the property name
Declared In
SICIDescriptor.h
– containProperty:
Check whether property exists or not
- (BOOL)containProperty:(NSString *)name
Parameters
name |
Name of the property |
---|
Return Value
(true/false) TRUE: If property exists | FALSE: If property does not exists.
Discussion
Check whether property exists or not
Declared In
SICIDescriptor.h
– addProperty:value:
Add property to the descriptor
- (void)addProperty:(NSString *)name value:(NSString *)value
Parameters
name |
Name of the property |
---|---|
value |
Value of the property |
Discussion
Add property to the descriptor
Declared In
SICIDescriptor.h
– removeProperty:
Remove property from the descriptor
- (void)removeProperty:(NSString *)name
Parameters
name |
Name of the property |
---|
Discussion
Remove property from the descriptor
Declared In
SICIDescriptor.h