Package com.pugwoo.dbhelper.impl.part
Class P4_InsertOrUpdateOp
java.lang.Object
com.pugwoo.dbhelper.impl.part.P0_JdbcTemplateOp
com.pugwoo.dbhelper.impl.part.P1_QueryOp
com.pugwoo.dbhelper.impl.part.P2_InsertOp
com.pugwoo.dbhelper.impl.part.P3_UpdateOp
com.pugwoo.dbhelper.impl.part.P4_InsertOrUpdateOp
- All Implemented Interfaces:
DBHelper,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
- Direct Known Subclasses:
P5_DeleteOp
-
Field Summary
Fields inherited from class com.pugwoo.dbhelper.impl.part.P0_JdbcTemplateOp
applicationContext, features, fetchSize, interceptors, jdbcTemplate, LOGGER, maxPageSize, namedParameterJdbcTemplate, timeoutWarningValve -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> intinsertOrUpdate(Collection<T> list) 如果t有主键,则更新值;否则插入记录。只有非null的值会更新或插入。<T> intinsertOrUpdate(T t) 如果t有主键,则更新值;否则插入记录。只有非null的值会更新或插入。<T> int如果t有主键,则更新值;否则插入记录。包括null的值会更新或插入。Methods inherited from class com.pugwoo.dbhelper.impl.part.P3_UpdateOp
update, update, update, updateAll, updateCustom, updateWithNull, updateWithNullMethods inherited from class com.pugwoo.dbhelper.impl.part.P2_InsertOp
insert, insert, insertBatchWithoutReturnId, insertBatchWithoutReturnId, insertBatchWithoutReturnId, insertWithNullMethods inherited from class com.pugwoo.dbhelper.impl.part.P1_QueryOp
getAll, getAll, getAllForStream, getAllForStream, getAllKey, getByExample, getByKey, getCount, getCount, getOne, getOne, getPage, getPage, getPageWithoutCount, getPageWithoutCount, getRaw, getRaw, getRawForStream, getRawForStream, getRawOne, getRawOne, handleRelatedColumn, handleRelatedColumn, handleRelatedColumn, handleRelatedColumn, isExist, isExistAtLeastMethods inherited from class com.pugwoo.dbhelper.impl.part.P0_JdbcTemplateOp
addComment, executeAfterCommit, getDatabaseType, getFeature, getJdbcTemplate, getNamedParameterJdbcTemplate, jdbcExecuteUpdate, log, logSlow, namedJdbcExecuteUpdate, namedJdbcExecuteUpdateWithLog, rollback, setApplicationContext, setFetchSize, setInterceptors, setJdbcTemplate, setMaxPageSize, setNamedParameterJdbcTemplate, setTimeoutWarningCallback, setTimeoutWarningValve, turnOffFeature, turnOnFeatureMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.pugwoo.dbhelper.DBHelper
delete, delete, delete, deleteHard, deleteHard, deleteHard, executeRaw, executeRaw
-
Constructor Details
-
P4_InsertOrUpdateOp
public P4_InsertOrUpdateOp()
-
-
Method Details
-
insertOrUpdate
public <T> int insertOrUpdate(T t) Description copied from interface:DBHelper如果t有主键,则更新值;否则插入记录。只有非null的值会更新或插入。- Parameters:
t- 需要插入的DO对象实例- Returns:
- 返回数据库实际修改的条数
-
insertOrUpdateWithNull
public <T> int insertOrUpdateWithNull(T t) Description copied from interface:DBHelper如果t有主键,则更新值;否则插入记录。包括null的值会更新或插入。- Parameters:
t- 需要插入的DO对象实例- Returns:
- 返回数据库实际修改的条数
-
insertOrUpdate
Description copied from interface:DBHelper如果t有主键,则更新值;否则插入记录。只有非null的值会更新或插入。- Parameters:
list- 需要插入的DO对象实例列表- Returns:
- 返回数据库实际修改的条数
-