Interface ResultListRowTransformer<S,Q extends FlexibleRelationalPathBase<R>,R>
-
- Type Parameters:
S
- schema typeQ
- type of entity pathR
- row type related to theResultListRowTransformer
public interface ResultListRowTransformer<S,Q extends FlexibleRelationalPathBase<R>,R>
Helps with row transformation of result lists, possibly in stateful context. This kind of transformation still has access to low-level row data if necessary. Typical example is container's owner OID which is lost in the container itself. For example, row-by-row transformation can collect information for some additional processing which can be executed by implementingfinishTransformation()
. Alternatively, the result list of tuples can be processed first withbeforeTransformation(java.util.List<com.querydsl.core.Tuple>, Q)
, for instance to fetch owner objects for the whole container list in a single query. The reason for this is thattransform(com.querydsl.core.Tuple, Q, java.util.Collection<com.evolveum.midpoint.schema.SelectorOptions<com.evolveum.midpoint.schema.GetOperationOptions>>)
already needs to return actual containers from the owner object. Leaving this fetch tofinishTransformation()
would require this method to transform the list again and replace "bare" containers with the real ones from owner objects. Finish method is useful when the objects in the final result list needs to be enriched, but not when they need to be replaced. (If this is necessary later, just add result list as parameter and returned value as well.)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default void
beforeTransformation(List<com.querydsl.core.Tuple> rowTuples, Q entityPath)
This allows preprocessing of results before the transformation.default void
finishTransformation()
This method is called after all the rows were transformed and allows for additional final shake-up for more complex stateful transformations.S
transform(com.querydsl.core.Tuple rowTuple, Q entityPath, Collection<SelectorOptions<GetOperationOptions>> options)
Transforms row tuple to the midPoint object.
-
-
-
Method Detail
-
beforeTransformation
default void beforeTransformation(List<com.querydsl.core.Tuple> rowTuples, Q entityPath) throws SchemaException
This allows preprocessing of results before the transformation. One example is to load owner objects for containers.- Throws:
SchemaException
-
transform
S transform(com.querydsl.core.Tuple rowTuple, Q entityPath, Collection<SelectorOptions<GetOperationOptions>> options)
Transforms row tuple to the midPoint object.
-
finishTransformation
default void finishTransformation() throws SchemaException
This method is called after all the rows were transformed and allows for additional final shake-up for more complex stateful transformations.- Throws:
SchemaException
-
-