T
- extends Product
public class ExistingProductLookup<T extends Product> extends ExistingEntityLookup<T>
Product
already exists, and if so load it based on various other settings provided by this class.
Lookup
TODO: Add unit test caseModifier and Type | Field and Description |
---|---|
protected ProductService<T> |
service |
mode, postponseLookup
customMergeActions, fieldNamesToMerge, ignoreNullsForPrimitiveTypes, immutableFieldNames, mergeFieldMode, typesRequireDeepCopy
Constructor and Description |
---|
ExistingProductLookup() |
ExistingProductLookup(ExistingEntityMergeTransformer t) |
Modifier and Type | Method and Description |
---|---|
protected T |
getEntity(T in)
Core method to identify and fetch the record that matches the in record
TODO: Add test case to ensure return type is exactly same as input type
|
protected T |
getNewProduct() |
ProductService<T> |
getService() |
void |
setService(ProductService<T> service) |
protected Object |
treatNewEntity(Object newObject,
Stack parents)
During the process of Merge/Copy if a new Object is being set it may need to be additionally treated.
Like persist on database etc before its set in the main Entity. |
getMode, getModesSupported, isPostponseLookup, setMode, setPostponseLookup, transform
copy, copySpecificTypes, getClosestParent, getCustomMergeAction, getCustomMergeActions, getFieldNamesToMerge, getIdentityFieldNames, getIdFieldsForClass, getImmutableFieldNames, getImmutableFieldsForClass, getTypesRequireDeepCopy, isIgnoreNullsForPrimitiveTypes, isMergeFieldMode, isMutable, isMutablePrimitive, isValidOrPrimitiveFieldType, mergeFields, requiredDeepCopy, setCustomMergeActions, setFieldNamesToMerge, setIdentityFieldNames, setIgnoreNullsForPrimitiveTypes, setImmutableFieldNames, setMergeFieldMode, setTypesRequireDeepCopy
protected ProductService<T extends Product> service
public ExistingProductLookup()
public ExistingProductLookup(ExistingEntityMergeTransformer t)
protected Object treatNewEntity(Object newObject, Stack parents)
ExistingEntityMergeTransformer
treatNewEntity
in class ExistingEntityMergeTransformer<T extends Product>
newObject
- as Object to be treated that is replacing a null value in the Existing entityparents
- as a Stack of parents; 0th being root entity and last being immediate parent. Parents are useful as we recurse down and need a reference to a parent entityprotected T getNewProduct()
protected T getEntity(T in) throws Exception
getEntity
in class ExistingEntityLookup<T extends Product>
in
- Exception
public ProductService<T> getService()
public void setService(ProductService<T> service)
Copyright © 2018. All rights reserved.