org.compass.core.mapping.osem
Class PlainCascadeMapping

java.lang.Object
  extended by org.compass.core.mapping.AbstractMapping
      extended by org.compass.core.mapping.osem.AbstractAccessorMapping
          extended by org.compass.core.mapping.osem.PlainCascadeMapping
All Implemented Interfaces:
CascadeMapping, Mapping, ObjectMapping, OsemMapping

public class PlainCascadeMapping
extends AbstractAccessorMapping
implements CascadeMapping

Author:
kimchy

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.compass.core.mapping.CascadeMapping
CascadeMapping.Cascade
 
Constructor Summary
PlainCascadeMapping()
           
 
Method Summary
 boolean canBeCollectionWrapped()
          Returns true if this object mapping can be wrapped with a Collection or an Array.
 boolean controlsObjectNullability()
          Returns true if the Mapping controlls the fact that if it has no value, it's parent might be a candidate for being nullable.
 Mapping copy()
          Copies over the mapping definition into a newly instanciated Mapping object.
 CascadeMapping.Cascade[] getCascades()
           
 Object getCascadeValue(Object root)
          Returns the value that should be cascaded basde on the root object.
 void setCascades(CascadeMapping.Cascade[] cascades)
           
 boolean shouldCascade(CascadeMapping.Cascade cascade)
          Returns true if cascading should be performed for the cascade parameter.
 boolean shouldCascadeCreate()
          Returns true if cascading should be performed for create operations.
 boolean shouldCascadeDelete()
          Returns true if cascading should be performed for delete operations.
 boolean shouldCascadeSave()
          Returns true if cascading should be performed for save operations.
 
Methods inherited from class org.compass.core.mapping.osem.AbstractAccessorMapping
copy, getAccessor, getDefinedInAlias, getGetter, getPropertyName, getSetter, hasAccessors, setAccessor, setDefinedInAlias, setGetter, setPropertyName, setSetter
 
Methods inherited from class org.compass.core.mapping.AbstractMapping
copy, getConverter, getConverterName, getName, getPath, setConverter, setConverterName, setName, setPath
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.compass.core.mapping.Mapping
getConverter, getConverterName, getName, getPath, setConverter, setConverterName, setName, setPath
 

Constructor Detail

PlainCascadeMapping

public PlainCascadeMapping()
Method Detail

copy

public Mapping copy()
Description copied from interface: Mapping
Copies over the mapping definition into a newly instanciated Mapping object.

Specified by:
copy in interface Mapping

canBeCollectionWrapped

public boolean canBeCollectionWrapped()
Description copied from interface: ObjectMapping
Returns true if this object mapping can be wrapped with a Collection or an Array.

Specified by:
canBeCollectionWrapped in interface ObjectMapping

controlsObjectNullability

public boolean controlsObjectNullability()
Description copied from interface: Mapping
Returns true if the Mapping controlls the fact that if it has no value, it's parent might be a candidate for being nullable.

Specified by:
controlsObjectNullability in interface Mapping
Overrides:
controlsObjectNullability in class AbstractMapping

getCascades

public CascadeMapping.Cascade[] getCascades()
Specified by:
getCascades in interface CascadeMapping

setCascades

public void setCascades(CascadeMapping.Cascade[] cascades)
Specified by:
setCascades in interface CascadeMapping

getCascadeValue

public Object getCascadeValue(Object root)
                       throws CompassException
Description copied from interface: CascadeMapping
Returns the value that should be cascaded basde on the root object.

Specified by:
getCascadeValue in interface CascadeMapping
Parameters:
root - The root object to extract the cascaded value from
Returns:
The cascaded value to cascade
Throws:
CompassException

shouldCascadeDelete

public boolean shouldCascadeDelete()
Description copied from interface: CascadeMapping
Returns true if cascading should be performed for delete operations.

Specified by:
shouldCascadeDelete in interface CascadeMapping

shouldCascadeCreate

public boolean shouldCascadeCreate()
Description copied from interface: CascadeMapping
Returns true if cascading should be performed for create operations.

Specified by:
shouldCascadeCreate in interface CascadeMapping

shouldCascadeSave

public boolean shouldCascadeSave()
Description copied from interface: CascadeMapping
Returns true if cascading should be performed for save operations.

Specified by:
shouldCascadeSave in interface CascadeMapping

shouldCascade

public boolean shouldCascade(CascadeMapping.Cascade cascade)
Description copied from interface: CascadeMapping
Returns true if cascading should be performed for the cascade parameter.

Specified by:
shouldCascade in interface CascadeMapping


Copyright (c) 2004-2008 The Compass Project.