hu.netmind.beankeeper
Interface DynamicObject

All Superinterfaces:
java.util.Map

public interface DynamicObject
extends java.util.Map

All objects implementing this interface are considered "dynamic", which means they can define their own attributes,attribute types and the table their "class" dynamically.
Note however, that when you change the set of attributes for this kind of objects, their representation in the database will change. All attributes in dynamic objects are held in the same table (no separate value tables), so if an attribute becomes deleted, it will resolve in a table column to be dropped. The data dropped will not be available, even through historical selects (because the table schema changed).
Dynamic objects can be in their own namespace, meaning they can have each it's own table, so caller may define different types dynamically with dynamic objects.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Method Summary
 java.lang.String getPersistenceDynamicName()
          Get the dynamic name of the class.
 void setPersistenceDynamicName(java.lang.String dynamicName)
          This method is called by the library during a select from database.
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

getPersistenceDynamicName

java.lang.String getPersistenceDynamicName()
Get the dynamic name of the class. If this is not null and non-empty, the library will create this name as it were a classname in the package designated by the real class' name. After saving such a class, the caller will be able to select for these kind of classes with the name specified inside find statements.

Returns:
The dynamic name of class. Any string which is null, or does not start with a letter is treated as an empty string, in which case the class' real name will be used.

setPersistenceDynamicName

void setPersistenceDynamicName(java.lang.String dynamicName)
This method is called by the library during a select from database. During the unmarshalling of the object, the library will set the dynamic name to the object,

Parameters:
cl - The class the name is queried for.
dynamicName - The dynamic name of the class as given when it was saved. If no (empty) dynamic name was given, it will be called with an empty string.