public abstract class CreateIfNecessaryTemplate<T,D extends OnmsDao<T,?>> extends UpsertTemplate<T,D>
UpsertTemplate. See the
detailed javadoc there for a description.m_dao, m_transactionManager| Constructor and Description |
|---|
CreateIfNecessaryTemplate(org.springframework.transaction.PlatformTransactionManager transactionManager,
D dao)
Create a CreateIfNecessaryTemplate using the given transactionManager to create transactions.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
doInsert()
Override this method to insert a new object into the database.
|
protected T |
doUpdate(T dbObj)
There is no need to update the object for this case as we just return the object found.
|
protected abstract T |
query()
Override this method to execute the query that is used to determine if there is an
existing object in the database
|
executepublic CreateIfNecessaryTemplate(org.springframework.transaction.PlatformTransactionManager transactionManager,
D dao)
protected abstract T query()
UpsertTemplateprotected T doUpdate(T dbObj)
protected abstract T doInsert()
UpsertTemplateCopyright © 2022. All rights reserved.