org.makumba
Interface DataDefinition

All Known Implementing Classes:
DataDefinitionImpl, FileRecordInfo, RecordInfo

public interface DataDefinition

Information about a makumba data definition as obtained from an MDD file or the structure of an MQL query result. This class is provided for makumba programs to be able to introspect makumba data structures. Such introspection is not needed usually, as the application programmer knows the makumba data structure.


Nested Class Summary
static class DataDefinition.MultipleUniqueKeyDefinition
          Data structure holding the definition of a mult-field unique key.
static class DataDefinition.QueryFragmentFunction
           
 
Field Summary
static String createName
           
static String modifyName
           
 
Method Summary
 void addField(FieldDefinition fd)
          Add a new field definition.
 void addMultiUniqueKey(DataDefinition.MultipleUniqueKeyDefinition definition)
          Add a multiple-feld uniqueness definition.
 void checkFieldNames(Dictionary<String,Object> d)
          Checks whether all fieldnames exist in the database
 void checkUpdate(String fieldName, Dictionary<String,Object> d)
          Checks whether a record can be updated *
 String getCreationDateFieldName()
          The name of the creation timestamp field, if any?
 FieldDefinition getFieldDefinition(int n)
          the field with the respective index, null if such a field doesn't exist
 FieldDefinition getFieldDefinition(String name)
          the field with the respective name, null if such a field doesn't exist
 Vector<String> getFieldNames()
          the names of the fields declared in this data definition, in the order of declaration
 FieldDefinition getFieldOrPointedFieldDefinition(String name)
          Returns a field definition that is either contained in this data definition, or in a pointed type.
 DataDefinition.QueryFragmentFunction getFunctionOrPointedFunction(String name)
          Returns a query function that is either contained in this data definition, or in a pointed type.
 QueryFragmentFunctions getFunctions()
          returns all functions in this data definition.
 String getIndexPointerFieldName()
          The name of the index field (primary key), if any?
 String getLastModificationDateFieldName()
          The name of the modification timestamp field, if any?
 DataDefinition.MultipleUniqueKeyDefinition[] getMultiFieldUniqueKeys()
          Get all multiple-feld uniqueness definition.
 String getName()
          name of this data definition
 FieldDefinition getParentField()
          If this type is the data pointed to by a 1-1 pointer or subset, return the field definition in the main record, otherwise return null
 ArrayList<FieldDefinition> getReferenceFields()
          Gets all the fields that are references to other tables, i.e. pointers and some types of sets.
 String getSetMemberFieldName()
          The name of the set member (Pointer, Character or Integer), for set subtypes
 String getSetOwnerFieldName()
          The name of the pointer to the main table, for set and internal set subtypes
 String getTitleFieldName()
          The title field indicated, or the default one
 ArrayList<FieldDefinition> getUniqueFields()
          Gets all the fields that have the unique modifier.
 ValidationDefinition getValidationDefinition()
          Get the validation definition associated with this data definition.
 boolean hasMultiUniqueKey(String[] fieldNames)
          Check whether this data definition has a multi-field uniqe key defined with the given fields.
 boolean isTemporary()
          tells whether this data definition was generated temporarily to depict a query result as opposed to being read from an MDD file
 long lastModified()
          Indicates when the data definition was modified the last time
 

Field Detail

createName

static final String createName
See Also:
Constant Field Values

modifyName

static final String modifyName
See Also:
Constant Field Values
Method Detail

getName

String getName()
name of this data definition


getFieldNames

Vector<String> getFieldNames()
the names of the fields declared in this data definition, in the order of declaration


getFieldDefinition

FieldDefinition getFieldDefinition(String name)
the field with the respective name, null if such a field doesn't exist


getFieldDefinition

FieldDefinition getFieldDefinition(int n)
the field with the respective index, null if such a field doesn't exist


getFieldOrPointedFieldDefinition

FieldDefinition getFieldOrPointedFieldDefinition(String name)
Returns a field definition that is either contained in this data definition, or in a pointed type.


getFunctionOrPointedFunction

DataDefinition.QueryFragmentFunction getFunctionOrPointedFunction(String name)
Returns a query function that is either contained in this data definition, or in a pointed type.


isTemporary

boolean isTemporary()
tells whether this data definition was generated temporarily to depict a query result as opposed to being read from an MDD file


getTitleFieldName

String getTitleFieldName()
The title field indicated, or the default one


getIndexPointerFieldName

String getIndexPointerFieldName()
The name of the index field (primary key), if any?


getCreationDateFieldName

String getCreationDateFieldName()
The name of the creation timestamp field, if any?


getLastModificationDateFieldName

String getLastModificationDateFieldName()
The name of the modification timestamp field, if any?


getParentField

FieldDefinition getParentField()
If this type is the data pointed to by a 1-1 pointer or subset, return the field definition in the main record, otherwise return null


getSetMemberFieldName

String getSetMemberFieldName()
The name of the set member (Pointer, Character or Integer), for set subtypes


getSetOwnerFieldName

String getSetOwnerFieldName()
The name of the pointer to the main table, for set and internal set subtypes


addField

void addField(FieldDefinition fd)
Add a new field definition. Works only for temporary data definitions


checkFieldNames

void checkFieldNames(Dictionary<String,Object> d)
Checks whether all fieldnames exist in the database


checkUpdate

void checkUpdate(String fieldName,
                 Dictionary<String,Object> d)
Checks whether a record can be updated *


lastModified

long lastModified()
Indicates when the data definition was modified the last time


getValidationDefinition

ValidationDefinition getValidationDefinition()
Get the validation definition associated with this data definition.


getMultiFieldUniqueKeys

DataDefinition.MultipleUniqueKeyDefinition[] getMultiFieldUniqueKeys()
Get all multiple-feld uniqueness definition.


addMultiUniqueKey

void addMultiUniqueKey(DataDefinition.MultipleUniqueKeyDefinition definition)
Add a multiple-feld uniqueness definition.


hasMultiUniqueKey

boolean hasMultiUniqueKey(String[] fieldNames)
Check whether this data definition has a multi-field uniqe key defined with the given fields.


getReferenceFields

ArrayList<FieldDefinition> getReferenceFields()
Gets all the fields that are references to other tables, i.e. pointers and some types of sets.


getUniqueFields

ArrayList<FieldDefinition> getUniqueFields()
Gets all the fields that have the unique modifier.


getFunctions

QueryFragmentFunctions getFunctions()
returns all functions in this data definition.