org.objectweb.jorm.mapper.rdb.lib
Class RdbPMapCluster

java.lang.Object
  |
  +--org.objectweb.jorm.mapper.rdb.lib.RdbPMapCluster
All Implemented Interfaces:
PMapCluster

public class RdbPMapCluster
extends java.lang.Object
implements PMapCluster

Defines the PMapCluster used to manage relational schema for the RDB mappers.

Author:
P. Dechamboux

Method Summary
 void addDependency(java.lang.String jcname)
           
 void classDefined(java.lang.String jcname)
           
 void createMappingStructures(boolean force)
          Creates the mapping structures defined by this map cluster.
 void deleteData()
          Deletes the data that have been inserted into the mapping structures defined by this map cluster.
 void deleteMappingStructures()
          Deletes all or part of the mapping structures defined by this map cluster when they exist.
 java.util.Collection getClusterClasses()
          Retrieves an Iterator over the collection of all JORM classes whose mapping structures have to be controlled altogether.
 java.util.Collection getUnResolvedDependencies()
           
 boolean isDefined()
          Indicates if the mapping cluster is fully defined.
 void start()
          Starts this map cluster.
 void stop()
          Stops this map cluster.
 void updateMappingStructures()
          Aligns existing mapping structures to the ones define by this map cluster.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

classDefined

public void classDefined(java.lang.String jcname)

getClusterClasses

public java.util.Collection getClusterClasses()
Retrieves an Iterator over the collection of all JORM classes whose mapping structures have to be controlled altogether.

Specified by:
getClusterClasses in interface PMapCluster
Returns:
The Iterator over this collection.

isDefined

public boolean isDefined()
Description copied from interface: PMapCluster
Indicates if the mapping cluster is fully defined.

Specified by:
isDefined in interface PMapCluster
Returns:
the 'true' value is the mapping cluster is fully defined, false otherwise.

getUnResolvedDependencies

public java.util.Collection getUnResolvedDependencies()
Specified by:
getUnResolvedDependencies in interface PMapCluster
Returns:
the collection of unresolved depencies. This is the list of jorm class name which must be mapped before starting the cluster.

addDependency

public void addDependency(java.lang.String jcname)

createMappingStructures

public void createMappingStructures(boolean force)
                             throws PException
Creates the mapping structures defined by this map cluster.

Specified by:
createMappingStructures in interface PMapCluster
Parameters:
force - If true, the creation of an existing table leads to an exception.
Throws:
PException - Thrown if it cannot be performed (especially if all or some of these mapping structures already exist.

deleteData

public void deleteData()
                throws PException
Deletes the data that have been inserted into the mapping structures defined by this map cluster.

Specified by:
deleteData in interface PMapCluster
Throws:
PException - Thrown when the data store cannot perform this operation.

deleteMappingStructures

public void deleteMappingStructures()
                             throws PException
Deletes all or part of the mapping structures defined by this map cluster when they exist. If they contain some data, they are also deleted.

Specified by:
deleteMappingStructures in interface PMapCluster
Throws:
PException - Thrown when the data store cannot perform this operation.

start

public void start()
           throws PException
Starts this map cluster. The following operation cannot be executed anymore: createMappingStructures, deleteMappingStructures, and updateMappingStructures.

Specified by:
start in interface PMapCluster
Throws:
PException

stop

public void stop()
          throws PException
Stops this map cluster.

Specified by:
stop in interface PMapCluster
Throws:
PException

updateMappingStructures

public void updateMappingStructures()
                             throws PException,
                                    java.lang.UnsupportedOperationException
Aligns existing mapping structures to the ones define by this map cluster. This operation allows schema evolution on existing data store. It is thus usually difficult to support in the general case.

Specified by:
updateMappingStructures in interface PMapCluster
Throws:
PException - Thrown when the data store cannot perform this operation.
java.lang.UnsupportedOperationException - Thrown if this operation is not supported by the mapping.