Last update: 2011-06-23

org.proteios.core.data
Interface ExtendableData

All Superinterfaces:
IdentifiableData

public interface ExtendableData
extends IdentifiableData

This class is inherited by data classes that supports per-server additions of columns to the underlying database table.

The added columns must be described in the extended-properties.xml configuration file. The format of the XML file is forced by a DTD. In summary:

<?xml version="1.0" ?>
<!DOCTYPE extended-properties SYSTEM "extended-properties.dtd" >
<extended-properties>
</extended-properties>

The name attribute of the <class> tag is the name of the data class that the extra property should be added to. That class must of course implement this interface. The <class> tag may contain one or more <property> tags. Here is a short description of the attributes for the <property> tag.

Attribute Description
name (required) The property name of the extended property. See ExtendedProperty.getName().
title The display title for the extended property. See ExtendedProperty.getTitle().
description A short description of the extended property. See ExtendedProperty.getDescription().
column (required) The database column name of the extended property. This value must of course be unique for each class. See ExtendedProperty.getColumn().
type (required) The type of the column. Allowed values are:
  • int
  • long
  • float
  • double
  • boolean
  • string
  • text
  • date
See ExtendedProperty.getType().
length The maximum allowed length of the value if it is a string property. See ExtendedProperty.getLength(). The default value is 255.
null If the column supports null values or not. Allowed values are:
  • true (default)
  • false
See ExtendedProperty.isNullable().
insert If the value for this property should be inserted into the database or not.
  • true (default)
  • false
See ExtendedProperty.isInsertable().
update If the value for this property should be updated in the database or not.
  • true (default)
  • false
See ExtendedProperty.isUpdateable().

Reference implementation

private Map<String, Object> extendedProperties;
public Object getExtended(String name)
{
   return extendedProperties == null ? null : extendedProperties.get(name);
}
public void setExtended(String name, Object value)
{
   if (extendedProperties == null) extendedProperties = new HashMap<String, Object>();
   extendedProperties.put(name, value);
}

Version:
2.0
Author:
Nicklas, Samuel
See Also:
ExtendedProperties, ExtendedProperty

Method Summary
 Object getExtended(String name)
          Get the value of an extended property.
 void setExtended(String name, Object value)
          Set the value of an extended property.
 
Methods inherited from interface org.proteios.core.data.IdentifiableData
getId, getVersion
 

Method Detail

getExtended

Object getExtended(String name)
Get the value of an extended property.

Parameters:
name - The name of the property
Returns:
The value of the property or null if not found

setExtended

void setExtended(String name,
                 Object value)
Set the value of an extended property.

Parameters:
name - The name of the property
value - The new value for the property

Last update: 2011-06-23