GNDMS 0.6.0
RESTful verison of GNDMS
Public Member Functions | Package Functions | Private Attributes

de.zib.gndms.logic.model.ModelTaskAction< O extends ModelIdHoldingOrder > Class Reference

Inherits de::zib::gndms::logic::model::DefaultTaskAction< O >.

List of all members.

Public Member Functions

 ModelTaskAction (final Class< O > orderClass)
DirectoryAux getDirectoryAux ()
void setDirectoryAux (final DirectoryAux directoryAux)

Package Functions

protected< M > M getModelEntity (final Class< M > modelClass)
 Delivers the model for the id given in the order object.
protected< M > M getEntity (final Class< M > modelClass, final String modelId)
 Loades an entity from the database.
protected< M > void deleteModelEntity (final Class< M > modelClass)
 Deletes the model-entity, whose id given in the order.
protected< M > void deleteEntity (final Class< M > modelClass, final String modelId)
 Deletes an entity from the database.

Private Attributes

DirectoryAux directoryAux

Detailed Description

Author:
Maik Jorra jorra@zib.de
Date:
22.12.11 16:57

Member Function Documentation

protected<M> void de.zib.gndms.logic.model.ModelTaskAction< O extends ModelIdHoldingOrder >.deleteEntity ( final Class< M >  modelClass,
final String  modelId 
) [package]

Deletes an entity from the database.

Parameters:
modelClassThe class of the entity, required for the look-up
modelIdThe id, i.e. primary key, of the entity.
                                                                                       {

        M model;
        EntityManager em = getEmf().createEntityManager();
        TxFrame tx = new TxFrame( em );
        try{
            model = em.find( modelClass, modelId );
            em.remove( model );
            tx.commit();
        } finally {
            tx.finish();
        }
    }
protected<M> void de.zib.gndms.logic.model.ModelTaskAction< O extends ModelIdHoldingOrder >.deleteModelEntity ( final Class< M >  modelClass) [package]

Deletes the model-entity, whose id given in the order.

ensuredOrder must have been called.

Parameters:
modelClassthe model class...
Returns:
The entity referenced by
                                                                      {

        deleteEntity( modelClass, getOrder().getModelId() );
    }
protected<M> M de.zib.gndms.logic.model.ModelTaskAction< O extends ModelIdHoldingOrder >.getEntity ( final Class< M >  modelClass,
final String  modelId 
) [package]

Loades an entity from the database.

Parameters:
modelClassThe class of the entity.
modelIdThe id, i.e. primary key, of the entity.
Returns:
The entity instance, in detached state.
                                                                                 {

        M model;
        EntityManager em = getEmf().createEntityManager();
        TxFrame tx = new TxFrame( em );
        try{
            model = em.find( modelClass, modelId );
            tx.commit();
        } finally {
            tx.finish();
        }
        return model;
    }
protected<M> M de.zib.gndms.logic.model.ModelTaskAction< O extends ModelIdHoldingOrder >.getModelEntity ( final Class< M >  modelClass) [package]

Delivers the model for the id given in the order object.

ensuredOrder must have been called.

Parameters:
modelClassthe model calls...
Returns:
The entity referenced by
                                                                {

        return getEntity( modelClass, getOrder().getModelId() );
    }

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables