Package com.landawn.abacus.jdbc.dao
Interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends CrudDao<T,ID,SB,TD>>
- Type Parameters:
T
-ID
- useVoid
if there is no id defined/annotated with@Id
in target entity classT
.SB
-SQLBuilder
used to generate sql scripts. Only can beSQLBuilder.PSC/PAC/PLC
- All Superinterfaces:
Dao<T,
SB, TD>
- All Known Subinterfaces:
CrudDaoL<T,
,SB, TD> NoUpdateCrudDao<T,
,ID, SB, TD> NoUpdateCrudDaoL<T,
,SB, TD> ReadOnlyCrudDao<T,
,ID, SB, TD> ReadOnlyCrudDaoL<T,
,SB, TD> UncheckedCrudDao<T,
,ID, SB, TD> UncheckedCrudDaoL<T,
,SB, TD> UncheckedNoUpdateCrudDao<T,
,ID, SB, TD> UncheckedNoUpdateCrudDaoL<T,
,SB, TD> UncheckedReadOnlyCrudDao<T,
,ID, SB, TD> UncheckedReadOnlyCrudDaoL<T,
SB, TD>
public interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends CrudDao<T,ID,SB,TD>>
extends Dao<T,SB,TD>
The Interface CrudDao.
- See Also:
-
JdbcUtil.prepareQuery(javax.sql.DataSource, String)
JdbcUtil.prepareNamedQuery(javax.sql.DataSource, String)
JdbcUtil.beginTransaction(javax.sql.DataSource, IsolationLevel, boolean)
Dao
SQLExecutor.Mapper
ConditionFactory
ConditionFactory.CF
-
Method Summary
Modifier and TypeMethodDescriptiondefault int
batchDelete
(Collection<? extends T> entities) int
batchDelete
(Collection<? extends T> entities, int batchSize) default int
batchDeleteByIds
(Collection<? extends ID> ids) int
batchDeleteByIds
(Collection<? extends ID> ids, int batchSize) batchGet
(Collection<? extends ID> ids) batchGet
(Collection<? extends ID> ids, int batchSize) batchGet
(Collection<? extends ID> ids, Collection<String> selectPropNames) batchGet
(Collection<? extends ID> ids, Collection<String> selectPropNames, int batchSize) batchInsert
(String namedInsertSQL, Collection<? extends T> entities) batchInsert
(String namedInsertSQL, Collection<? extends T> entities, int batchSize) batchInsert
(Collection<? extends T> entities) batchInsert
(Collection<? extends T> entities, int batchSize) batchInsert
(Collection<? extends T> entities, Collection<String> propNamesToInsert) batchInsert
(Collection<? extends T> entities, Collection<String> propNamesToInsert, int batchSize) default int
batchRefresh
(Collection<? extends T> entities) default int
batchRefresh
(Collection<? extends T> entities, int batchSize) default int
batchRefresh
(Collection<? extends T> entities, Collection<String> propNamesToRefresh) default int
batchRefresh
(Collection<? extends T> entities, Collection<String> propNamesToRefresh, int batchSize) default int
batchUpdate
(Collection<? extends T> entities) int
batchUpdate
(Collection<? extends T> entities, int batchSize) default int
batchUpdate
(Collection<? extends T> entities, Collection<String> propNamesToUpdate) int
batchUpdate
(Collection<? extends T> entities, Collection<String> propNamesToUpdate, int batchSize) batchUpsert
(Collection<? extends T> entities) batchUpsert
(Collection<? extends T> entities, int batchSize) batchUpsert
(Collection<? extends T> entities, List<String> uniquePropNamesForQuery) batchUpsert
(Collection<? extends T> entities, List<String> uniquePropNamesForQuery, int batchSize) int
count
(Collection<? extends ID> ids) Count the records in db by inputids
.int
int
deleteById
(ID id) Delete by id.boolean
default ID
Deprecated.unsupported Operationdefault com.landawn.abacus.util.u.Optional<T>
Returns the record found by the specifiedid
or an emptyOptional
if no record is found.default com.landawn.abacus.util.u.Optional<T>
get
(ID id, Collection<String> selectPropNames) Returns the record found by the specifiedid
or an emptyOptional
if no record is found.Returns the record found by the specifiedid
ornull
if no record is found.gett
(ID id, Collection<String> selectPropNames) Returns the record found by the specifiedid
ornull
if no record is found.default Jdbc.BiRowMapper<ID>
insert
(T entityToInsert, Collection<String> propNamesToInsert) default boolean
com.landawn.abacus.util.u.OptionalBoolean
queryForBoolean
(String singleSelectPropName, ID id) Returns anOptionalBoolean
describing the value in the first row/column if it exists, otherwise return an emptyOptionalBoolean
.com.landawn.abacus.util.u.OptionalByte
queryForByte
(String singleSelectPropName, ID id) Returns anOptionalByte
describing the value in the first row/column if it exists, otherwise return an emptyOptionalByte
.com.landawn.abacus.util.u.Nullable<byte[]>
queryForBytes
(String singleSelectPropName, ID id) Returns aNullable<byte[]>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.com.landawn.abacus.util.u.OptionalChar
queryForChar
(String singleSelectPropName, ID id) Returns anOptionalChar
describing the value in the first row/column if it exists, otherwise return an emptyOptionalChar
.com.landawn.abacus.util.u.Nullable<Date>
queryForDate
(String singleSelectPropName, ID id) Returns aNullable<java.sql.Date>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.com.landawn.abacus.util.u.OptionalDouble
queryForDouble
(String singleSelectPropName, ID id) Returns anOptionalDouble
describing the value in the first row/column if it exists, otherwise return an emptyOptionalDouble
.com.landawn.abacus.util.u.OptionalFloat
queryForFloat
(String singleSelectPropName, ID id) Returns anOptionalFloat
describing the value in the first row/column if it exists, otherwise return an emptyOptionalFloat
.com.landawn.abacus.util.u.OptionalInt
queryForInt
(String singleSelectPropName, ID id) Returns anOptionalInt
describing the value in the first row/column if it exists, otherwise return an emptyOptionalInt
.com.landawn.abacus.util.u.OptionalLong
queryForLong
(String singleSelectPropName, ID id) Returns anOptionalLong
describing the value in the first row/column if it exists, otherwise return an emptyOptionalLong
.com.landawn.abacus.util.u.OptionalShort
queryForShort
(String singleSelectPropName, ID id) Returns anOptionalShort
describing the value in the first row/column if it exists, otherwise return an emptyOptionalShort
.<V> com.landawn.abacus.util.u.Optional<V>
queryForSingleNonNull
(Class<? extends V> targetValueClass, String singleSelectPropName, ID id) Returns anOptional
describing the value in the first row/column if it exists, otherwise return an emptyOptional
.<V> com.landawn.abacus.util.u.Optional<V>
queryForSingleNonNull
(String singleSelectPropName, ID id, Jdbc.RowMapper<? extends V> rowMapper) Returns anOptional
describing the value in the first row/column if it exists, otherwise return an emptyOptional
.<V> com.landawn.abacus.util.u.Nullable<V>
queryForSingleResult
(Class<? extends V> targetValueClass, String singleSelectPropName, ID id) Returns aNullable<V>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.com.landawn.abacus.util.u.Nullable<String>
queryForString
(String singleSelectPropName, ID id) Returns aNullable<String>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.com.landawn.abacus.util.u.Nullable<Time>
queryForTime
(String singleSelectPropName, ID id) Returns aNullable<java.sql.Time>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.com.landawn.abacus.util.u.Nullable<Timestamp>
queryForTimestamp
(String singleSelectPropName, ID id) Returns aNullable<java.sql.Timestamp>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.<V> com.landawn.abacus.util.u.Optional<V>
queryForUniqueNonNull
(Class<? extends V> targetValueClass, String singleSelectPropName, ID id) Returns anOptional
describing the value in the first row/column if it exists, otherwise return an emptyOptional
.<V> com.landawn.abacus.util.u.Optional<V>
queryForUniqueNonNull
(String singleSelectPropName, ID id, Jdbc.RowMapper<? extends V> rowMapper) Returns anOptional
describing the value in the first row/column if it exists, otherwise return an emptyOptional
.<V> com.landawn.abacus.util.u.Nullable<V>
queryForUniqueResult
(Class<? extends V> targetValueClass, String singleSelectPropName, ID id) Returns aNullable
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.default boolean
default boolean
refresh
(T entity, Collection<String> propNamesToRefresh) default int
int
int
int
update
(T entityToUpdate, Collection<String> propNamesToUpdate) default T
Executeadd
and return the added entity if the record doesn't, otherwise,update
is executed and updated db record is returned.default T
Executeadd
and return the added entity if the record doesn't, otherwise,update
is executed and updated db record is returned.default T
Methods inherited from interface com.landawn.abacus.jdbc.dao.Dao
asyncCall, asyncCall, asyncExecutor, asyncRun, asyncRun, batchSave, batchSave, batchSave, batchSave, batchSave, batchSave, count, dataSource, delete, executor, exists, findFirst, findFirst, findFirst, findFirst, findFirst, findFirst, findOnlyOne, findOnlyOne, findOnlyOne, findOnlyOne, findOnlyOne, findOnlyOne, foreach, foreach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, forEach, list, list, list, list, list, list, list, list, list, list, list, list, list, notExists, paginate, paginate, paginate, paginate, paginate, paginate, prepareCallableQuery, prepareCallableQuery, prepareNamedQuery, prepareNamedQuery, prepareNamedQuery, prepareNamedQuery, prepareNamedQuery, prepareNamedQuery, prepareNamedQuery, prepareNamedQuery, prepareNamedQuery, prepareNamedQuery, prepareNamedQuery, prepareNamedQuery, prepareNamedQueryForBigResult, prepareNamedQueryForBigResult, prepareNamedQueryForBigResult, prepareQuery, prepareQuery, prepareQuery, prepareQuery, prepareQuery, prepareQuery, prepareQuery, prepareQueryForBigResult, prepareQueryForBigResult, prepareQueryForBigResult, query, query, query, query, query, query, queryForBoolean, queryForByte, queryForBytes, queryForChar, queryForDate, queryForDouble, queryForFloat, queryForInt, queryForLong, queryForShort, queryForSingleNonNull, queryForSingleNonNull, queryForSingleResult, queryForString, queryForTime, queryForTimestamp, queryForUniqueNonNull, queryForUniqueNonNull, queryForUniqueResult, save, save, save, sqlMapper, stream, stream, stream, stream, stream, stream, stream, stream, stream, stream, stream, stream, stream, targetEntityClass, targetTableName, update, update, update, update
-
Method Details
-
idExtractor
- Returns:
-
generateId
Deprecated.unsupported Operation- Returns:
- Throws:
SQLException
UnsupportedOperationException
-
insert
- Parameters:
entityToInsert
-- Returns:
- Throws:
SQLException
-
insert
- Parameters:
entityToInsert
-propNamesToInsert
-- Returns:
- Throws:
SQLException
-
insert
- Parameters:
namedInsertSQL
-entityToInsert
-- Returns:
- Throws:
SQLException
-
batchInsert
- Parameters:
entities
-- Returns:
- Throws:
SQLException
-
batchInsert
- Parameters:
entities
-batchSize
-- Returns:
- Throws:
SQLException
-
batchInsert
default List<ID> batchInsert(Collection<? extends T> entities, Collection<String> propNamesToInsert) throws SQLException - Parameters:
entities
-propNamesToInsert
-- Returns:
- Throws:
SQLException
-
batchInsert
List<ID> batchInsert(Collection<? extends T> entities, Collection<String> propNamesToInsert, int batchSize) throws SQLException - Parameters:
entities
-propNamesToInsert
-batchSize
-- Returns:
- Throws:
SQLException
-
batchInsert
@Beta default List<ID> batchInsert(String namedInsertSQL, Collection<? extends T> entities) throws SQLException - Parameters:
namedInsertSQL
-entities
-- Returns:
- Throws:
SQLException
-
batchInsert
@Beta List<ID> batchInsert(String namedInsertSQL, Collection<? extends T> entities, int batchSize) throws SQLException - Parameters:
namedInsertSQL
-entities
-batchSize
-- Returns:
- Throws:
SQLException
-
queryForBoolean
com.landawn.abacus.util.u.OptionalBoolean queryForBoolean(String singleSelectPropName, ID id) throws SQLException Returns anOptionalBoolean
describing the value in the first row/column if it exists, otherwise return an emptyOptionalBoolean
.- Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForBoolean()
-
queryForChar
com.landawn.abacus.util.u.OptionalChar queryForChar(String singleSelectPropName, ID id) throws SQLException Returns anOptionalChar
describing the value in the first row/column if it exists, otherwise return an emptyOptionalChar
.- Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForChar()
-
queryForByte
com.landawn.abacus.util.u.OptionalByte queryForByte(String singleSelectPropName, ID id) throws SQLException Returns anOptionalByte
describing the value in the first row/column if it exists, otherwise return an emptyOptionalByte
.- Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForByte()
-
queryForShort
com.landawn.abacus.util.u.OptionalShort queryForShort(String singleSelectPropName, ID id) throws SQLException Returns anOptionalShort
describing the value in the first row/column if it exists, otherwise return an emptyOptionalShort
.- Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForShort()
-
queryForInt
com.landawn.abacus.util.u.OptionalInt queryForInt(String singleSelectPropName, ID id) throws SQLException Returns anOptionalInt
describing the value in the first row/column if it exists, otherwise return an emptyOptionalInt
.- Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForInt()
-
queryForLong
com.landawn.abacus.util.u.OptionalLong queryForLong(String singleSelectPropName, ID id) throws SQLException Returns anOptionalLong
describing the value in the first row/column if it exists, otherwise return an emptyOptionalLong
.- Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForLong()
-
queryForFloat
com.landawn.abacus.util.u.OptionalFloat queryForFloat(String singleSelectPropName, ID id) throws SQLException Returns anOptionalFloat
describing the value in the first row/column if it exists, otherwise return an emptyOptionalFloat
.- Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForFloat()
-
queryForDouble
com.landawn.abacus.util.u.OptionalDouble queryForDouble(String singleSelectPropName, ID id) throws SQLException Returns anOptionalDouble
describing the value in the first row/column if it exists, otherwise return an emptyOptionalDouble
.- Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForDouble()
-
queryForString
com.landawn.abacus.util.u.Nullable<String> queryForString(String singleSelectPropName, ID id) throws SQLException Returns aNullable<String>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.- Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForString()
-
queryForDate
com.landawn.abacus.util.u.Nullable<Date> queryForDate(String singleSelectPropName, ID id) throws SQLException Returns aNullable<java.sql.Date>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.- Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForDate()
-
queryForTime
com.landawn.abacus.util.u.Nullable<Time> queryForTime(String singleSelectPropName, ID id) throws SQLException Returns aNullable<java.sql.Time>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.- Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForTime()
-
queryForTimestamp
com.landawn.abacus.util.u.Nullable<Timestamp> queryForTimestamp(String singleSelectPropName, ID id) throws SQLException Returns aNullable<java.sql.Timestamp>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.- Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForTimestamp()
-
queryForBytes
com.landawn.abacus.util.u.Nullable<byte[]> queryForBytes(String singleSelectPropName, ID id) throws SQLException Returns aNullable<byte[]>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.- Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForBytes()
-
queryForSingleResult
<V> com.landawn.abacus.util.u.Nullable<V> queryForSingleResult(Class<? extends V> targetValueClass, String singleSelectPropName, ID id) throws SQLException Returns aNullable<V>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.- Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForSingleResult(Class)
-
queryForSingleNonNull
<V> com.landawn.abacus.util.u.Optional<V> queryForSingleNonNull(Class<? extends V> targetValueClass, String singleSelectPropName, ID id) throws SQLException Returns anOptional
describing the value in the first row/column if it exists, otherwise return an emptyOptional
.- Type Parameters:
V
- the value type- Parameters:
targetValueClass
-singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForSingleNonNull(Class)
-
queryForSingleNonNull
@Beta <V> com.landawn.abacus.util.u.Optional<V> queryForSingleNonNull(String singleSelectPropName, ID id, Jdbc.RowMapper<? extends V> rowMapper) throws SQLException Returns anOptional
describing the value in the first row/column if it exists, otherwise return an emptyOptional
.- Type Parameters:
V
- the value type- Parameters:
singleSelectPropName
-id
-rowMapper
-- Returns:
- Throws:
SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForSingleNonNull(Class)
-
queryForUniqueResult
<V> com.landawn.abacus.util.u.Nullable<V> queryForUniqueResult(Class<? extends V> targetValueClass, String singleSelectPropName, ID id) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException Returns aNullable
describing the value in the first row/column if it exists, otherwise return an emptyNullable
. And throwsDuplicatedResultException
if more than one record found.- Type Parameters:
V
- the value type- Parameters:
targetValueClass
-singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
- if more than one record found by the specifiedid
(orcondition
).SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForUniqueResult(Class)
-
queryForUniqueNonNull
<V> com.landawn.abacus.util.u.Optional<V> queryForUniqueNonNull(Class<? extends V> targetValueClass, String singleSelectPropName, ID id) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException Returns anOptional
describing the value in the first row/column if it exists, otherwise return an emptyOptional
.- Type Parameters:
V
- the value type- Parameters:
targetValueClass
-singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
- if more than one record found by the specifiedid
(orcondition
).SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForUniqueNonNull(Class)
-
queryForUniqueNonNull
@Beta <V> com.landawn.abacus.util.u.Optional<V> queryForUniqueNonNull(String singleSelectPropName, ID id, Jdbc.RowMapper<? extends V> rowMapper) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException Returns anOptional
describing the value in the first row/column if it exists, otherwise return an emptyOptional
.- Type Parameters:
V
- the value type- Parameters:
singleSelectPropName
-id
-rowMapper
-- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
- if more than one record found by the specifiedid
(orcondition
).SQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForUniqueNonNull(Class)
-
get
default com.landawn.abacus.util.u.Optional<T> get(ID id) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException Returns the record found by the specifiedid
or an emptyOptional
if no record is found.- Parameters:
id
-- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
- if more than one record found by the specifiedid
(orcondition
).SQLException
-
get
default com.landawn.abacus.util.u.Optional<T> get(ID id, Collection<String> selectPropNames) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException Returns the record found by the specifiedid
or an emptyOptional
if no record is found.- Parameters:
id
-selectPropNames
- all properties(columns) will be selected, excluding the properties of joining entities, if the specifiedselectPropNames
isnull
.- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
- if more than one record found by the specifiedid
(orcondition
).SQLException
-
gett
Returns the record found by the specifiedid
ornull
if no record is found.- Parameters:
id
-- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
- if more than one record found by the specifiedid
(orcondition
).SQLException
-
gett
T gett(ID id, Collection<String> selectPropNames) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException Returns the record found by the specifiedid
ornull
if no record is found.- Parameters:
id
-selectPropNames
- all properties(columns) will be selected, excluding the properties of joining entities, if the specifiedselectPropNames
isnull
.- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
- if more than one record found by the specifiedid
(orcondition
).SQLException
-
batchGet
default List<T> batchGet(Collection<? extends ID> ids) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException - Parameters:
ids
-- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
- if the size of result is bigger than the size of inputids
.SQLException
-
batchGet
default List<T> batchGet(Collection<? extends ID> ids, int batchSize) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException - Parameters:
ids
-batchSize
-- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
- if the size of result is bigger than the size of inputids
.SQLException
-
batchGet
default List<T> batchGet(Collection<? extends ID> ids, Collection<String> selectPropNames) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException - Parameters:
ids
-selectPropNames
- all properties(columns) will be selected, excluding the properties of joining entities, if the specifiedselectPropNames
isnull
. all properties(columns) will be selected, excluding the properties of joining entities, if the specifiedselectPropNames
isnull
.- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
- if the size of result is bigger than the size of inputids
.SQLException
-
batchGet
List<T> batchGet(Collection<? extends ID> ids, Collection<String> selectPropNames, int batchSize) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException - Parameters:
ids
-selectPropNames
- all properties(columns) will be selected, excluding the properties of joining entities, if the specifiedselectPropNames
isnull
. all properties(columns) will be selected, excluding the properties of joining entities, ifselectPropNames
isnull
.batchSize
-- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
- if the size of result is bigger than the size of inputids
.SQLException
-
exists
- Parameters:
id
-- Returns:
- true, if successful
- Throws:
SQLException
- See Also:
-
notExists
- Parameters:
id
-- Returns:
- Throws:
SQLException
- See Also:
-
count
Count the records in db by inputids
.- Parameters:
ids
-- Returns:
- Throws:
SQLException
-
update
- Parameters:
entityToUpdate
-- Returns:
- Throws:
SQLException
-
update
- Parameters:
entityToUpdate
-propNamesToUpdate
-- Returns:
- Throws:
SQLException
-
update
- Parameters:
propName
-propValue
-id
-- Returns:
- Throws:
SQLException
-
update
- Parameters:
updateProps
-id
-- Returns:
- Throws:
SQLException
-
batchUpdate
- Parameters:
entities
-- Returns:
- Throws:
SQLException
-
batchUpdate
- Parameters:
entities
-batchSize
-- Returns:
- Throws:
SQLException
-
batchUpdate
default int batchUpdate(Collection<? extends T> entities, Collection<String> propNamesToUpdate) throws SQLException - Parameters:
entities
-propNamesToUpdate
-- Returns:
- Throws:
SQLException
-
batchUpdate
int batchUpdate(Collection<? extends T> entities, Collection<String> propNamesToUpdate, int batchSize) throws SQLException - Parameters:
entities
-propNamesToUpdate
-batchSize
-- Returns:
- Throws:
SQLException
-
upsert
Executeadd
and return the added entity if the record doesn't, otherwise,update
is executed and updated db record is returned.- Parameters:
entity
-- Returns:
- Throws:
SQLException
-
upsert
- Parameters:
entity
-uniquePropNamesForQuery
-- Returns:
- Throws:
SQLException
-
upsert
Executeadd
and return the added entity if the record doesn't, otherwise,update
is executed and updated db record is returned. -
batchUpsert
- Parameters:
entities
-- Returns:
- Throws:
SQLException
-
batchUpsert
- Parameters:
entities
-batchSize
-- Returns:
- Throws:
SQLException
-
batchUpsert
default List<T> batchUpsert(Collection<? extends T> entities, List<String> uniquePropNamesForQuery) throws SQLException - Parameters:
entities
-uniquePropNamesForQuery
-- Returns:
- Throws:
SQLException
-
batchUpsert
default List<T> batchUpsert(Collection<? extends T> entities, List<String> uniquePropNamesForQuery, int batchSize) throws SQLException - Parameters:
entities
-uniquePropNamesForQuery
-batchSize
-- Returns:
- Throws:
SQLException
-
refresh
- Parameters:
entity
-- Returns:
- true, if successful
- Throws:
SQLException
-
refresh
- Parameters:
entity
-propNamesToRefresh
-- Returns:
false
if no record found by the ids in the specifiedentity
.- Throws:
SQLException
-
batchRefresh
- Parameters:
entities
-- Returns:
- the count of refreshed entities.
- Throws:
SQLException
-
batchRefresh
- Parameters:
entities
-batchSize
-- Returns:
- the count of refreshed entities.
- Throws:
SQLException
-
batchRefresh
default int batchRefresh(Collection<? extends T> entities, Collection<String> propNamesToRefresh) throws SQLException - Parameters:
entities
-propNamesToRefresh
-- Returns:
- the count of refreshed entities.
- Throws:
SQLException
-
batchRefresh
default int batchRefresh(Collection<? extends T> entities, Collection<String> propNamesToRefresh, int batchSize) throws SQLException - Parameters:
entities
-propNamesToRefresh
-batchSize
-- Returns:
- the count of refreshed entities.
- Throws:
SQLException
-
delete
- Parameters:
entity
-- Returns:
- Throws:
SQLException
-
deleteById
Delete by id.- Parameters:
id
-- Returns:
- Throws:
SQLException
-
batchDelete
- Parameters:
entities
-- Returns:
- Throws:
SQLException
-
batchDelete
- Parameters:
entities
-batchSize
-- Returns:
- Throws:
SQLException
-
batchDeleteByIds
- Parameters:
ids
-- Returns:
- Throws:
SQLException
-
batchDeleteByIds
- Parameters:
ids
-batchSize
-- Returns:
- Throws:
SQLException
-