Package com.landawn.abacus.jdbc.dao
Interface UncheckedCrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<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:
CrudDao<T,
,ID, SB, TD> Dao<T,
,SB, TD> UncheckedDao<T,
SB, TD>
- All Known Subinterfaces:
UncheckedCrudDaoL<T,
,SB, TD> UncheckedNoUpdateCrudDao<T,
,ID, SB, TD> UncheckedNoUpdateCrudDaoL<T,
,SB, TD> UncheckedReadOnlyCrudDao<T,
,ID, SB, TD> UncheckedReadOnlyCrudDaoL<T,
SB, TD>
@Beta
public interface UncheckedCrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
extends UncheckedDao<T,SB,TD>, CrudDao<T,ID,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.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.CrudDao
idExtractor
Methods inherited from interface com.landawn.abacus.jdbc.dao.Dao
asyncCall, asyncCall, asyncExecutor, asyncRun, asyncRun, dataSource, executor, 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, sqlMapper, stream, stream, stream, stream, stream, stream, stream, stream, stream, stream, stream, stream, stream, targetEntityClass, targetTableName
Methods inherited from interface com.landawn.abacus.jdbc.dao.UncheckedDao
batchSave, batchSave, batchSave, batchSave, batchSave, batchSave, count, delete, 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, 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, update, update, update, update
-
Method Details
-
generateId
@Deprecated default ID generateId() throws com.landawn.abacus.exception.UncheckedSQLException, UnsupportedOperationExceptionDeprecated.unsupported Operation- Specified by:
generateId
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
UnsupportedOperationException
- the unchecked SQL exception
-
insert
-
insert
ID insert(T entityToInsert, Collection<String> propNamesToInsert) throws com.landawn.abacus.exception.UncheckedSQLException -
insert
-
batchInsert
default List<ID> batchInsert(Collection<? extends T> entities) throws com.landawn.abacus.exception.UncheckedSQLException -
batchInsert
List<ID> batchInsert(Collection<? extends T> entities, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException -
batchInsert
default List<ID> batchInsert(Collection<? extends T> entities, Collection<String> propNamesToInsert) throws com.landawn.abacus.exception.UncheckedSQLException -
batchInsert
List<ID> batchInsert(Collection<? extends T> entities, Collection<String> propNamesToInsert, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException -
batchInsert
@Beta default List<ID> batchInsert(String namedInsertSQL, Collection<? extends T> entities) throws com.landawn.abacus.exception.UncheckedSQLException -
batchInsert
@Beta List<ID> batchInsert(String namedInsertSQL, Collection<? extends T> entities, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException -
queryForBoolean
com.landawn.abacus.util.u.OptionalBoolean queryForBoolean(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException Returns anOptionalBoolean
describing the value in the first row/column if it exists, otherwise return an emptyOptionalBoolean
.- Specified by:
queryForBoolean
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForBoolean()
-
queryForChar
com.landawn.abacus.util.u.OptionalChar queryForChar(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException Returns anOptionalChar
describing the value in the first row/column if it exists, otherwise return an emptyOptionalChar
.- Specified by:
queryForChar
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForChar()
-
queryForByte
com.landawn.abacus.util.u.OptionalByte queryForByte(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException Returns anOptionalByte
describing the value in the first row/column if it exists, otherwise return an emptyOptionalByte
.- Specified by:
queryForByte
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForByte()
-
queryForShort
com.landawn.abacus.util.u.OptionalShort queryForShort(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException Returns anOptionalShort
describing the value in the first row/column if it exists, otherwise return an emptyOptionalShort
.- Specified by:
queryForShort
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForShort()
-
queryForInt
com.landawn.abacus.util.u.OptionalInt queryForInt(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException Returns anOptionalInt
describing the value in the first row/column if it exists, otherwise return an emptyOptionalInt
.- Specified by:
queryForInt
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForInt()
-
queryForLong
com.landawn.abacus.util.u.OptionalLong queryForLong(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException Returns anOptionalLong
describing the value in the first row/column if it exists, otherwise return an emptyOptionalLong
.- Specified by:
queryForLong
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForLong()
-
queryForFloat
com.landawn.abacus.util.u.OptionalFloat queryForFloat(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException Returns anOptionalFloat
describing the value in the first row/column if it exists, otherwise return an emptyOptionalFloat
.- Specified by:
queryForFloat
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForFloat()
-
queryForDouble
com.landawn.abacus.util.u.OptionalDouble queryForDouble(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException Returns anOptionalDouble
describing the value in the first row/column if it exists, otherwise return an emptyOptionalDouble
.- Specified by:
queryForDouble
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForDouble()
-
queryForString
com.landawn.abacus.util.u.Nullable<String> queryForString(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException Returns aNullable<String>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.- Specified by:
queryForString
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForString()
-
queryForDate
com.landawn.abacus.util.u.Nullable<Date> queryForDate(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException Returns aNullable<java.sql.Date>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.- Specified by:
queryForDate
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForDate()
-
queryForTime
com.landawn.abacus.util.u.Nullable<Time> queryForTime(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException Returns aNullable<java.sql.Time>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.- Specified by:
queryForTime
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForTime()
-
queryForTimestamp
com.landawn.abacus.util.u.Nullable<Timestamp> queryForTimestamp(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException Returns aNullable<java.sql.Timestamp>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.- Specified by:
queryForTimestamp
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForTimestamp()
-
queryForBytes
com.landawn.abacus.util.u.Nullable<byte[]> queryForBytes(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException Returns aNullable<byte[]>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.- Specified by:
queryForBytes
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- 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 com.landawn.abacus.exception.UncheckedSQLException Returns aNullable<V>
describing the value in the first row/column if it exists, otherwise return an emptyNullable
.- Specified by:
queryForSingleResult
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- 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 com.landawn.abacus.exception.UncheckedSQLException Returns anOptional
describing the value in the first row/column if it exists, otherwise return an emptyOptional
.- Specified by:
queryForSingleNonNull
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Type Parameters:
V
- the value type- Parameters:
targetValueClass
-singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForSingleNonNull(Class)
-
queryForSingleNonNull
<V> com.landawn.abacus.util.u.Optional<V> queryForSingleNonNull(String singleSelectPropName, ID id, Jdbc.RowMapper<? extends V> rowMapper) throws com.landawn.abacus.exception.UncheckedSQLException Returns anOptional
describing the value in the first row/column if it exists, otherwise return an emptyOptional
.- Specified by:
queryForSingleNonNull
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Type Parameters:
V
- the value type- Parameters:
singleSelectPropName
-id
-rowMapper
-- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- 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, com.landawn.abacus.exception.UncheckedSQLException 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.- Specified by:
queryForUniqueResult
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - 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
).com.landawn.abacus.exception.UncheckedSQLException
- 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, com.landawn.abacus.exception.UncheckedSQLException Returns anOptional
describing the value in the first row/column if it exists, otherwise return an emptyOptional
.- Specified by:
queryForUniqueNonNull
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - 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
).com.landawn.abacus.exception.UncheckedSQLException
- See Also:
-
ConditionFactory
ConditionFactory.CF
AbstractQuery.queryForUniqueNonNull(Class)
-
queryForUniqueNonNull
<V> com.landawn.abacus.util.u.Optional<V> queryForUniqueNonNull(String singleSelectPropName, ID id, Jdbc.RowMapper<? extends V> rowMapper) throws com.landawn.abacus.exception.DuplicatedResultException, com.landawn.abacus.exception.UncheckedSQLException Returns anOptional
describing the value in the first row/column if it exists, otherwise return an emptyOptional
.- Specified by:
queryForUniqueNonNull
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - 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
).com.landawn.abacus.exception.UncheckedSQLException
- 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, com.landawn.abacus.exception.UncheckedSQLException Description copied from interface:CrudDao
Returns the record found by the specifiedid
or an emptyOptional
if no record is found.- Specified by:
get
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
id
-- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
- if more than one record found by the specifiedid
(orcondition
).com.landawn.abacus.exception.UncheckedSQLException
- the unchecked SQL exception
-
get
default com.landawn.abacus.util.u.Optional<T> get(ID id, Collection<String> selectPropNames) throws com.landawn.abacus.exception.DuplicatedResultException, com.landawn.abacus.exception.UncheckedSQLException Description copied from interface:CrudDao
Returns the record found by the specifiedid
or an emptyOptional
if no record is found.- Specified by:
get
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - 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
).com.landawn.abacus.exception.UncheckedSQLException
- the unchecked SQL exception
-
gett
T gett(ID id) throws com.landawn.abacus.exception.DuplicatedResultException, com.landawn.abacus.exception.UncheckedSQLException Description copied from interface:CrudDao
Returns the record found by the specifiedid
ornull
if no record is found.- Specified by:
gett
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
id
-- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
- if more than one record found by the specifiedid
(orcondition
).com.landawn.abacus.exception.UncheckedSQLException
- the unchecked SQL exception
-
gett
T gett(ID id, Collection<String> selectPropNames) throws com.landawn.abacus.exception.DuplicatedResultException, com.landawn.abacus.exception.UncheckedSQLException Description copied from interface:CrudDao
Returns the record found by the specifiedid
ornull
if no record is found.- Specified by:
gett
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - 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
).com.landawn.abacus.exception.UncheckedSQLException
- the unchecked SQL exception
-
batchGet
default List<T> batchGet(Collection<? extends ID> ids) throws com.landawn.abacus.exception.DuplicatedResultException, com.landawn.abacus.exception.UncheckedSQLException - Specified by:
batchGet
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
ids
-- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
- if the size of result is bigger than the size of inputids
.com.landawn.abacus.exception.UncheckedSQLException
- the unchecked SQL exception
-
batchGet
default List<T> batchGet(Collection<? extends ID> ids, int batchSize) throws com.landawn.abacus.exception.DuplicatedResultException, com.landawn.abacus.exception.UncheckedSQLException - Specified by:
batchGet
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
ids
-batchSize
-- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
- if the size of result is bigger than the size of inputids
.com.landawn.abacus.exception.UncheckedSQLException
- the unchecked SQL exception
-
batchGet
default List<T> batchGet(Collection<? extends ID> ids, Collection<String> selectPropNames) throws com.landawn.abacus.exception.DuplicatedResultException, com.landawn.abacus.exception.UncheckedSQLException - Specified by:
batchGet
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
ids
-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 the size of result is bigger than the size of inputids
.com.landawn.abacus.exception.UncheckedSQLException
- the unchecked SQL exception
-
batchGet
List<T> batchGet(Collection<? extends ID> ids, Collection<String> selectPropNames, int batchSize) throws com.landawn.abacus.exception.DuplicatedResultException, com.landawn.abacus.exception.UncheckedSQLException - Specified by:
batchGet
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
ids
-selectPropNames
- all properties(columns) will be selected, excluding the properties of joining entities, if the specifiedselectPropNames
isnull
.batchSize
-- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
- if the size of result is bigger than the size of inputids
.com.landawn.abacus.exception.UncheckedSQLException
- the unchecked SQL exception
-
exists
-
notExists
-
count
@Beta int count(Collection<? extends ID> ids) throws com.landawn.abacus.exception.UncheckedSQLException Description copied from interface:CrudDao
Count the records in db by inputids
. -
update
-
update
int update(T entityToUpdate, Collection<String> propNamesToUpdate) throws com.landawn.abacus.exception.UncheckedSQLException -
update
-
update
-
batchUpdate
default int batchUpdate(Collection<? extends T> entities) throws com.landawn.abacus.exception.UncheckedSQLException -
batchUpdate
int batchUpdate(Collection<? extends T> entities, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException -
batchUpdate
default int batchUpdate(Collection<? extends T> entities, Collection<String> propNamesToUpdate) throws com.landawn.abacus.exception.UncheckedSQLException -
batchUpdate
int batchUpdate(Collection<? extends T> entities, Collection<String> propNamesToUpdate, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException -
upsert
Executeadd
and return the added entity if the record doesn't, otherwise,update
is executed and updated db record is returned. -
upsert
-
upsert
default T upsert(T entity, com.landawn.abacus.condition.Condition cond) throws com.landawn.abacus.exception.UncheckedSQLException Executeadd
and return the added entity if the record doesn't, otherwise,update
is executed and updated db record is returned.- Specified by:
upsert
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Specified by:
upsert
in interfaceDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder> - Specified by:
upsert
in interfaceUncheckedDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder> - Parameters:
entity
-cond
- to verify if the record exists or not.- Returns:
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- the unchecked SQL exception- See Also:
-
ConditionFactory
ConditionFactory.CF
-
batchUpsert
default List<T> batchUpsert(Collection<? extends T> entities) throws com.landawn.abacus.exception.UncheckedSQLException -
batchUpsert
default List<T> batchUpsert(Collection<? extends T> entities, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException -
batchUpsert
-
batchUpsert
-
refresh
-
refresh
default boolean refresh(T entity, Collection<String> propNamesToRefresh) throws com.landawn.abacus.exception.UncheckedSQLException - Specified by:
refresh
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
entity
-propNamesToRefresh
-- Returns:
false
if no record found by the ids in the specifiedentity
.- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- the unchecked SQL exception
-
batchRefresh
default int batchRefresh(Collection<? extends T> entities) throws com.landawn.abacus.exception.UncheckedSQLException -
batchRefresh
default int batchRefresh(Collection<? extends T> entities, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException - Specified by:
batchRefresh
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
entities
-batchSize
-- Returns:
- the count of refreshed entities.
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- the unchecked SQL exception
-
batchRefresh
default int batchRefresh(Collection<? extends T> entities, Collection<String> propNamesToRefresh) throws com.landawn.abacus.exception.UncheckedSQLException - Specified by:
batchRefresh
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
entities
-propNamesToRefresh
-- Returns:
- the count of refreshed entities.
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- the unchecked SQL exception
-
batchRefresh
default int batchRefresh(Collection<? extends T> entities, Collection<String> propNamesToRefresh, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException - Specified by:
batchRefresh
in interfaceCrudDao<T,
ID, SB extends com.landawn.abacus.util.SQLBuilder, TD extends UncheckedCrudDao<T, ID, SB, TD>> - Parameters:
entities
-propNamesToRefresh
-batchSize
-- Returns:
- the count of refreshed entities.
- Throws:
com.landawn.abacus.exception.UncheckedSQLException
- the unchecked SQL exception
-
delete
-
deleteById
Delete by id. -
batchDelete
default int batchDelete(Collection<? extends T> entities) throws com.landawn.abacus.exception.UncheckedSQLException -
batchDelete
int batchDelete(Collection<? extends T> entities, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException -
batchDeleteByIds
default int batchDeleteByIds(Collection<? extends ID> ids) throws com.landawn.abacus.exception.UncheckedSQLException -
batchDeleteByIds
int batchDeleteByIds(Collection<? extends ID> ids, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException
-