com.atlassian.greenhopper.manager
Class AbstractRelatedAOListMapper<P,T extends Entity,U extends AbstractModel>

java.lang.Object
  extended by com.atlassian.greenhopper.manager.AbstractRelatedAOListMapper<P,T,U>
All Implemented Interfaces:
AOListMapper<T,U>
Direct Known Subclasses:
CardColorAOListMapper, ColumnAOListMapper, DetailViewFieldAOListMapper, EstimateStatisticAOListMapper, QuickFilterAOListMapper, SubqueryAOListMapper, SwimlaneAOListMapper, TrackingStatisticAOListMapper

public abstract class AbstractRelatedAOListMapper<P,T extends Entity,U extends AbstractModel>
extends java.lang.Object
implements AOListMapper<T,U>

Abstract class of a AOListMapper for an entity T which has a relationship with parent entity P.

Since:
v5.9.5

Field Summary
protected  RelatedAOMapper<P,T,U> mapper
           
protected  P parentAO
           
 
Constructor Summary
protected AbstractRelatedAOListMapper(P parentAO, RelatedAOMapper<P,T,U> mapper)
           
 
Method Summary
 void addCreateValues(U model, java.util.Map<java.lang.String,java.lang.Object> params)
          Provide the db parameter for T to be created.
 T findExisting(T[] recordAOs, U model)
          Get an existing T for given u.
 java.util.List<U> fromAO(T[] ts)
           
abstract  java.lang.Class<T> getActiveObjectClass()
          Get the class of T
abstract  T[] getExisting()
          Provides all existing T.
abstract  void postCreateUpdate(T recordAO, U model)
          Called on the updated AO object (either once created or updated/saved).
abstract  void preDelete(T recordAO)
          Called before the element is deleted, gives the mapper a chance to clean up child objects
 void setValues(T recordAO, U model)
          Updates an AO.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parentAO

protected final P parentAO

mapper

protected final RelatedAOMapper<P,T extends Entity,U extends AbstractModel> mapper
Constructor Detail

AbstractRelatedAOListMapper

protected AbstractRelatedAOListMapper(P parentAO,
                                      RelatedAOMapper<P,T,U> mapper)
Method Detail

addCreateValues

public void addCreateValues(U model,
                            java.util.Map<java.lang.String,java.lang.Object> params)
Description copied from interface: AOListMapper
Provide the db parameter for T to be created.

Specified by:
addCreateValues in interface AOListMapper<T extends Entity,U extends AbstractModel>

setValues

public void setValues(T recordAO,
                      U model)
Description copied from interface: AOListMapper
Updates an AO. Note that save should not be called.

Specified by:
setValues in interface AOListMapper<T extends Entity,U extends AbstractModel>

findExisting

public T findExisting(T[] recordAOs,
                      U model)
Description copied from interface: AOListMapper
Get an existing T for given u. Returns null if not found.

Specified by:
findExisting in interface AOListMapper<T extends Entity,U extends AbstractModel>

fromAO

public java.util.List<U> fromAO(T[] ts)
Specified by:
fromAO in interface AOListMapper<T extends Entity,U extends AbstractModel>

getActiveObjectClass

public abstract java.lang.Class<T> getActiveObjectClass()
Description copied from interface: AOListMapper
Get the class of T

Specified by:
getActiveObjectClass in interface AOListMapper<T extends Entity,U extends AbstractModel>

postCreateUpdate

public abstract void postCreateUpdate(T recordAO,
                                      U model)
Description copied from interface: AOListMapper
Called on the updated AO object (either once created or updated/saved). Gives the mapper a chance to do further work, e.g. update child objects.

Specified by:
postCreateUpdate in interface AOListMapper<T extends Entity,U extends AbstractModel>

preDelete

public abstract void preDelete(T recordAO)
Description copied from interface: AOListMapper
Called before the element is deleted, gives the mapper a chance to clean up child objects

Specified by:
preDelete in interface AOListMapper<T extends Entity,U extends AbstractModel>

getExisting

public abstract T[] getExisting()
Description copied from interface: AOListMapper
Provides all existing T.

Specified by:
getExisting in interface AOListMapper<T extends Entity,U extends AbstractModel>


Copyright © 2007-2012 Atlassian. All Rights Reserved.