org.jpox.store.mapped
Interface DatastoreField

All Superinterfaces:
DatastoreObject

public interface DatastoreField
extends DatastoreObject

Representation of a Java field in a datastore. In the case of RDBMS this will be a column. In the case of a file-based structure this may be a file. In the case of an XML-based structure this may be an node.

Version:
$Revision: 1.12 $

Method Summary
 java.lang.String applySelectFunction(java.lang.String replacementValue)
          Wraps the column name with a FUNCTION.
 void copyConfigurationTo(DatastoreField col)
          Copy the configuration of this field to another field
 DatastoreContainerObject getDatastoreContainerObject()
          Accessor for the DatastoreContainerObject container of this field
 DatastoreMapping getDatastoreMapping()
          Accessor for the datastore mapping that this datastore field relates to.
 AbstractMemberMetaData getFieldMetaData()
          Accessor for the MetaData of the field that this is the datastore field for.
 JavaTypeMapping getMapping()
          Accessor for the Mapping for this field.
 MetaData getMetaData()
          Access the metadata definition defining this DatastoreField.
 java.lang.String getStoredJavaType()
          Accessor for the type of data stored in this field.
 boolean isNullable()
          Accessor for whether the field is nullable in the datastore.
 boolean isPrimaryKey()
          Accessor for whether the field is the primary key in the datastore.
 void setAsPrimaryKey()
          Mutator to make the field the primary key.
 void setDatastoreMapping(DatastoreMapping mapping)
          Method to associate this datastore field with its mapping.
 DatastoreField setDefaultable()
          Mutator for the defaultability of the datastore field.
 void setIdentifier(DatastoreIdentifier identifier)
          Mutator for the identifier of the column.
 void setMetaData(MetaData md)
          Method to set the MetaData for this datastore field.
 DatastoreField setNullable()
          Mutator for the nullability of the datastore field.
 
Methods inherited from interface org.jpox.store.mapped.DatastoreObject
getIdentifier, getStoreManager
 

Method Detail

getStoredJavaType

java.lang.String getStoredJavaType()
Accessor for the type of data stored in this field.

Returns:
The type of data in the field.

setAsPrimaryKey

void setAsPrimaryKey()
Mutator to make the field the primary key.


isPrimaryKey

boolean isPrimaryKey()
Accessor for whether the field is the primary key in the datastore.

Returns:
whether the field is (part of) the primary key

isNullable

boolean isNullable()
Accessor for whether the field is nullable in the datastore.

Returns:
whether the field is nullable

getDatastoreMapping

DatastoreMapping getDatastoreMapping()
Accessor for the datastore mapping that this datastore field relates to.

Returns:
The datastore mapping

setDatastoreMapping

void setDatastoreMapping(DatastoreMapping mapping)
Method to associate this datastore field with its mapping.

Parameters:
mapping - The mapping for this datastore field

getMapping

JavaTypeMapping getMapping()
Accessor for the Mapping for this field. TODO Change this to DatastoreMapping since a DatastoreField maps via that and not JavaTypeMapping.

Returns:
The Mapping

getDatastoreContainerObject

DatastoreContainerObject getDatastoreContainerObject()
Accessor for the DatastoreContainerObject container of this field

Returns:
The DatastoreContainerObject

applySelectFunction

java.lang.String applySelectFunction(java.lang.String replacementValue)
Wraps the column name with a FUNCTION.
example: SQRT(?) generates: SQRT(columnName)

Parameters:
replacementValue - the replacement to ?. Probably it's a column name, that may be fully qualified name or not
Returns:
a String with function taking as parameter the replacementValue

copyConfigurationTo

void copyConfigurationTo(DatastoreField col)
Copy the configuration of this field to another field

Parameters:
col - the datastore field

setNullable

DatastoreField setNullable()
Mutator for the nullability of the datastore field.

Returns:
The datastore field with the updated info

setDefaultable

DatastoreField setDefaultable()
Mutator for the defaultability of the datastore field.

Returns:
The datastore field with the updated info

setIdentifier

void setIdentifier(DatastoreIdentifier identifier)
Mutator for the identifier of the column.

Parameters:
identifier - The identifier

getMetaData

MetaData getMetaData()
Access the metadata definition defining this DatastoreField.

Returns:
the MetaData

setMetaData

void setMetaData(MetaData md)
Method to set the MetaData for this datastore field. Should only be called before completion of initialisation.

Parameters:
md - The MetaData

getFieldMetaData

AbstractMemberMetaData getFieldMetaData()
Accessor for the MetaData of the field that this is the datastore field for.

Returns:
MetaData of the field (if representing a field of a class).


Copyright © -2008 . All Rights Reserved.