org.nuiton.topia.persistence.util
Interface Creator<P,E>

Type Parameters:
P - the type of the parent of the entity to create (if entity has no parent then used the Void type).
E - the type of entity to create

public interface Creator<P,E>

A simple contract to hook the creation phase of an entity associated (or not!) to a parent entity.

Author:
chemit

Method Summary
 E create(P parent, E from)
          Perform the creation of an entity.
 

Method Detail

create

E create(P parent,
         E from)
         throws TopiaException
Perform the creation of an entity.

The given from entity should not have already been created in database ? it should only be here to prepare the creation of the entity. TODO Review this explanation :)

Parameters:
parent - the parent of the entity
from - the entity to create
Returns:
the really created entity in database
Throws:
TopiaException - if any db problem.


Copyright © 2004-2010 CodeLutin. All Rights Reserved.