com.groiss.store
Class ExportablePersistentObject

java.lang.Object
  extended by com.groiss.store.PersistentObject
      extended by com.groiss.store.ExportablePersistentObject
All Implemented Interfaces:
KeyValuePair<java.lang.Object,java.lang.Object>, Exportable, Persistent, java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
DirectoryServer

public abstract class ExportablePersistentObject
extends PersistentObject
implements Exportable

this is an extension to the PersistentObject class which can be exported via the @enterprise import/export functionality all required Exportable-methods are implemented with default behavior

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.groiss.store.PersistentObject
filled, oid
 
Fields inherited from interface com.groiss.store.Exportable
emptyKeys
 
Constructor Summary
ExportablePersistentObject()
           
 
Method Summary
 void beforeImport(java.util.Map<java.lang.String,Persistent> oidmapping)
          This method is called by the importer after the object is filled with data.
 java.util.List<java.lang.reflect.Field> exportFields()
          Here a class can return the names of fields which should be exported during an @enterprise export.
 java.util.List<Exportable> getAdditionalObjects(boolean isMainObject)
          return a list of objects that must be exported with this object (after it).
 java.lang.String[][] getKeys()
          A class has to return key groups in order to identify already existing objects of that class.
 java.util.List<Exportable> getRequiredObjects(boolean isMainObject)
          This method is called by the exporter before an object is exported.
 java.util.List<Exportable> getRequiredReferences()
          Returns a list of references that cannot be found in the persistent fields.
 
Methods inherited from class com.groiss.store.PersistentObject
clone, dbFields, equals, getKey, getOid, getStore, getValue, hashCode, isFilled, onDelete, onInsert, onRead, onUpdate, setFilled, setOid, setStore
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.groiss.store.Persistent
dbFields, getOid, getStore, getTableName, isFilled, onDelete, onInsert, onRead, onUpdate, setFilled, setOid, setStore
 

Constructor Detail

ExportablePersistentObject

public ExportablePersistentObject()
Method Detail

getRequiredObjects

public java.util.List<Exportable> getRequiredObjects(boolean isMainObject)
                                              throws java.lang.Exception
Description copied from interface: Exportable
This method is called by the exporter before an object is exported. The object can add required objects.

Specified by:
getRequiredObjects in interface Exportable
Parameters:
isMainObject - is this a reference to an exported object
Returns:
preReqObjects List containing required objects. Required objects must be Persistent objects implementing the Exportable interface.
Throws:
java.lang.Exception

getAdditionalObjects

public java.util.List<Exportable> getAdditionalObjects(boolean isMainObject)
                                                throws java.lang.Exception
Description copied from interface: Exportable
return a list of objects that must be exported with this object (after it).

Specified by:
getAdditionalObjects in interface Exportable
Parameters:
isMainObject - is this a reference to an exported object
Throws:
java.lang.Exception

getRequiredReferences

public java.util.List<Exportable> getRequiredReferences()
                                                 throws java.lang.Exception
Description copied from interface: Exportable
Returns a list of references that cannot be found in the persistent fields.

Specified by:
getRequiredReferences in interface Exportable
Returns:
a list of exportable
Throws:
java.lang.Exception

beforeImport

public void beforeImport(java.util.Map<java.lang.String,Persistent> oidmapping)
Description copied from interface: Exportable
This method is called by the importer after the object is filled with data. The object can change itself

Specified by:
beforeImport in interface Exportable
Parameters:
oidmapping - contains a map of the object identifier (classname:oid) to the new objects.

getKeys

public java.lang.String[][] getKeys()
Description copied from interface: Exportable
A class has to return key groups in order to identify already existing objects of that class. A key group must uniquely identify an object. This method returns an array of arrays, because a class can have more than one key group. In that case each of the key groups must be unique for an object to be unique (thus, group1 matches OR group2 matches etc.).

Specified by:
getKeys in interface Exportable
Returns:
An array of arrays containing object field names of the fields which form key groups for uniquely identifying objects of classes implementing this interface. An example would be {{"name", "birthdate"}} for a class defining one key group containing the fields name and birthdate.

exportFields

public java.util.List<java.lang.reflect.Field> exportFields()
                                                     throws java.lang.Exception
Description copied from interface: Exportable
Here a class can return the names of fields which should be exported during an @enterprise export.

Specified by:
exportFields in interface Exportable
Returns:
A list containing the fields for export.
Throws:
java.lang.Exception


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.