Interface Loador<E>
- Type Parameters:
E- type of bean to load
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
TopiaEntityBinder
A simple contract to load an object from another one.
- Author:
- tchemit <chemit@codelutin.com>
-
Method Summary
Modifier and TypeMethodDescriptionObtains the type of the entity.voidBind an entity to another.obtainProperties(E from, String... propertyNames) Obtain from an entity all data to bind to another one according the definition of the loador.
-
Method Details
-
getSourceType
Obtains the type of the entity.- Returns:
- the type of entity
-
obtainProperties
Obtain from an entity all data to bind to another one according the definition of the loador. This method is usefull when you can not directly used theload(Object, Object, boolean, String...)method. For example, when an entity has a immutable business key (says with an hibernate naturalId for example), and that you want to create the data in a db, you must give all the properties at the create time so this method allow you to do it).- Parameters:
from- the entity to bindpropertyNames- subset of properties to load- Returns:
- the map of properties to bind from the given entity.
-
load
Bind an entity to another.- Parameters:
from- the source entitydst- the destination entitytech- a flag to bind or not the technical values of the entity (says TopiaId, TopiaVersion and TopiaCreateDate).propertyNames- subset of properties to load
-