public class ProductPersistTransformer<P extends Product> extends EntityPersistTransformer<P>
Modifier and Type | Field and Description |
---|---|
protected boolean |
allowMultipleParents
While inserting a record, if the record already exists and has a legitimate parent,
then create a
ProductAlias for it |
protected ProductService<P> |
productService |
em, exceptions, failFast, messages, tm
Constructor and Description |
---|
ProductPersistTransformer() |
Modifier and Type | Method and Description |
---|---|
protected Object |
getId(P entity) |
protected P |
getNewProduct() |
ProductService<P> |
getProductService() |
org.springframework.transaction.TransactionDefinition |
getTransactionDef() |
boolean |
isAllowMultipleParents()
While inserting a record, if the record already exists and has a legitimate parent,
then create a
ProductAlias for it |
protected boolean |
saveProductAlias(P p)
Handle the process of creating/updating a
ProductAlias
Create an Alias for a request of parent Hierarchy that is different that an existing one only else reject the request |
void |
setAllowMultipleParents(boolean allowMultipleParents)
While inserting a record, if the record already exists and has a legitimate parent,
then create a
ProductAlias for it |
void |
setProductService(ProductService<P> productService) |
void |
setTransactionDef(org.springframework.transaction.TransactionDefinition transactionDef) |
Collection<P> |
write(Collection<P> input)
Write a Buffer of records at a given time.
|
P |
write(P record)
Write a record
|
close, getExceptions, getMessages, handleException, init, isExecuteUnderTransaction, isFailFast, isInitialized, setExceptions, setExecuteUnderTransaction, setFailFast, setMessages, transform
protected ProductService<P extends Product> productService
protected boolean allowMultipleParents
ProductAlias
for itpublic ProductService<P> getProductService()
public void setProductService(ProductService<P> productService)
protected P getNewProduct()
protected boolean saveProductAlias(P p)
ProductAlias
p
- as Product; non-committed version from the ETL. It may not have an Product.getId()
and it may have a different parent need than the one existing already@Transactional(readOnly=false) public Collection<P> write(Collection<P> input)
RealTimeWriter
write
in interface RealTimeWriter<P extends Product>
write
in class EntityPersistTransformer<P extends Product>
input
- as Collection
of records to be written to sink.@Transactional(readOnly=false) public P write(P record)
RealTimeWriter
write
in interface RealTimeWriter<P extends Product>
write
in class EntityPersistTransformer<P extends Product>
public boolean isAllowMultipleParents()
ProductAlias
for itpublic void setAllowMultipleParents(boolean allowMultipleParents)
ProductAlias
for itpublic org.springframework.transaction.TransactionDefinition getTransactionDef()
getTransactionDef
in class EntityPersistTransformer<P extends Product>
EntityPersistTransformer.executeUnderTransaction
public void setTransactionDef(org.springframework.transaction.TransactionDefinition transactionDef)
setTransactionDef
in class EntityPersistTransformer<P extends Product>
EntityPersistTransformer.executeUnderTransaction
Copyright © 2018. All rights reserved.