public interface QueryMapper
| Modifier and Type | Method and Description |
|---|---|
void |
apply(Object instance,
String name,
Object value) |
Object |
createFrom(Object parentInstance,
String name)
Method called to get domain instance (POJO) when calling the
property() method. |
boolean |
map(ResultSetWrapper rsw,
Object instance,
List<MapColumn> mapColumns)
collecting the data from the database and put in the domain instance.
|
Object createFrom(Object parentInstance, String name)
property() method.
This method is only called when there is a need to create a new instance.
If the parent instance is null, it means we are asking for the root object to be instantiated.
Otherwise we are asking an instance of the type defined by the property defined in 'name' in the parent instance.
Override this method to provide your own implementation for a different domain object.
We defer the setting of the instance, by returning a lambda, because we may wish not to set the value.
e.g: in an outer join, all related fields came as null, therefore it is a empty entityparentInstance - parent instancename - name of the parent property that we want to instantiate forboolean map(ResultSetWrapper rsw, Object instance, List<MapColumn> mapColumns)
rsw - resultset wrapperinstance - domain instance to returnmapColumns - column mapping infoCopyright © 2019. All rights reserved.