Package org.dynamoframework.rest.crud
Class EntityCopier
java.lang.Object
org.dynamoframework.rest.crud.EntityCopier
A class used to create copies of an entity or list of entities
This is mainly used in order to "hide" attributes that are not relevant in a given situation (because "visibleInGrid" or "visibleInForm" is false for a particular attribute)
This is also used to get around infinite loops in the JSON structure, because this any references from detail objects back to their parents
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<ID2,U extends AbstractEntity<ID2>>
UcopyResult(U input, EntityModel<U> model) Creates a copy of the provided entity with all irrelevant fields omitted<ID2,U extends AbstractEntity<ID2>>
List<U> copyResults(List<U> input, EntityModel<U> model) Creates a copy of the provided list of entities, with all irrelevant fields omittedstatic Object
-
Constructor Details
-
EntityCopier
public EntityCopier()
-
-
Method Details
-
copyResults
public <ID2,U extends AbstractEntity<ID2>> List<U> copyResults(List<U> input, EntityModel<U> model) Creates a copy of the provided list of entities, with all irrelevant fields omitted- Parameters:
input- the list of input entitiesmodel- the model- Returns:
- the copies
-
copyResult
Creates a copy of the provided entity with all irrelevant fields omitted- Type Parameters:
ID2- the type of the ID of the entityU- the type of the entity- Parameters:
input- the entity copymodel- the entity model to use- Returns:
- the copied entity
-
unproxy
-