Package com.landawn.abacus.jdbc.dao
Interface CrudDaoL<T,SB extends com.landawn.abacus.util.SQLBuilder,TD extends CrudDaoL<T,SB,TD>>
- Type Parameters:
T
-SB
-SQLBuilder
used to generate sql scripts. Only can beSQLBuilder.PSC/PAC/PLC
TD
-
- All Known Subinterfaces:
NoUpdateCrudDaoL<T,
,SB, TD> ReadOnlyCrudDaoL<T,
,SB, TD> UncheckedCrudDaoL<T,
,SB, TD> UncheckedNoUpdateCrudDaoL<T,
,SB, TD> UncheckedReadOnlyCrudDaoL<T,
SB, TD>
@Beta
public interface CrudDaoL<T,SB extends com.landawn.abacus.util.SQLBuilder,TD extends CrudDaoL<T,SB,TD>>
extends CrudDao<T,Long,SB,TD>
- See Also:
-
ConditionFactory
ConditionFactory.CF
-
Method Summary
Modifier and TypeMethodDescriptiondefault int
deleteById
(long id) default boolean
exists
(long id) default com.landawn.abacus.util.u.Optional<T>
get
(long id) Returns the record found by the specifiedid
or an emptyOptional
if no record is found.default com.landawn.abacus.util.u.Optional<T>
get
(long id, Collection<String> selectPropNames) Returns the record found by the specifiedid
or an emptyOptional
if no record is found.default T
gett
(long id) Returns the record found by the specifiedid
ornull
if no record is found.default T
gett
(long id, Collection<String> selectPropNames) Returns the record found by the specifiedid
ornull
if no record is found.default boolean
notExists
(long id) default com.landawn.abacus.util.u.OptionalBoolean
queryForBoolean
(String singleSelectPropName, long id) default com.landawn.abacus.util.u.OptionalByte
queryForByte
(String singleSelectPropName, long id) default com.landawn.abacus.util.u.Nullable<byte[]>
queryForBytes
(String singleSelectPropName, long id) default com.landawn.abacus.util.u.OptionalChar
queryForChar
(String singleSelectPropName, long id) default com.landawn.abacus.util.u.Nullable<Date>
queryForDate
(String singleSelectPropName, long id) default com.landawn.abacus.util.u.OptionalDouble
queryForDouble
(String singleSelectPropName, long id) default com.landawn.abacus.util.u.OptionalFloat
queryForFloat
(String singleSelectPropName, long id) default com.landawn.abacus.util.u.OptionalInt
queryForInt
(String singleSelectPropName, long id) default com.landawn.abacus.util.u.OptionalLong
queryForLong
(String singleSelectPropName, long id) default com.landawn.abacus.util.u.OptionalShort
queryForShort
(String singleSelectPropName, long id) default <V> com.landawn.abacus.util.u.Optional<V>
queryForSingleNonNull
(Class<? extends V> targetValueClass, String singleSelectPropName, long id) default <V> com.landawn.abacus.util.u.Optional<V>
queryForSingleNonNull
(String singleSelectPropName, long id, Jdbc.RowMapper<? extends V> rowMapper) default <V> com.landawn.abacus.util.u.Nullable<V>
queryForSingleResult
(Class<? extends V> targetValueClass, String singleSelectPropName, long id) default com.landawn.abacus.util.u.Nullable<String>
queryForString
(String singleSelectPropName, long id) default com.landawn.abacus.util.u.Nullable<Time>
queryForTime
(String singleSelectPropName, long id) default com.landawn.abacus.util.u.Nullable<Timestamp>
queryForTimestamp
(String singleSelectPropName, long id) default <V> com.landawn.abacus.util.u.Optional<V>
queryForUniqueNonNull
(Class<? extends V> targetValueClass, String singleSelectPropName, long id) default <V> com.landawn.abacus.util.u.Optional<V>
queryForUniqueNonNull
(String singleSelectPropName, long id, Jdbc.RowMapper<? extends V> rowMapper) default <V> com.landawn.abacus.util.u.Nullable<V>
queryForUniqueResult
(Class<? extends V> targetValueClass, String singleSelectPropName, long id) default int
default int
Methods inherited from interface com.landawn.abacus.jdbc.dao.CrudDao
batchDelete, batchDelete, batchDeleteByIds, batchDeleteByIds, batchGet, batchGet, batchGet, batchGet, batchInsert, batchInsert, batchInsert, batchInsert, batchInsert, batchInsert, batchRefresh, batchRefresh, batchRefresh, batchRefresh, batchUpdate, batchUpdate, batchUpdate, batchUpdate, batchUpsert, batchUpsert, batchUpsert, batchUpsert, count, delete, deleteById, exists, generateId, get, get, gett, gett, idExtractor, insert, insert, insert, notExists, queryForBoolean, queryForByte, queryForBytes, queryForChar, queryForDate, queryForDouble, queryForFloat, queryForInt, queryForLong, queryForShort, queryForSingleNonNull, queryForSingleNonNull, queryForSingleResult, queryForString, queryForTime, queryForTimestamp, queryForUniqueNonNull, queryForUniqueNonNull, queryForUniqueResult, refresh, refresh, update, update, update, update, upsert, upsert, upsert
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, 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
-
queryForBoolean
default com.landawn.abacus.util.u.OptionalBoolean queryForBoolean(String singleSelectPropName, long id) throws SQLException - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
-
queryForChar
default com.landawn.abacus.util.u.OptionalChar queryForChar(String singleSelectPropName, long id) throws SQLException - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
-
queryForByte
default com.landawn.abacus.util.u.OptionalByte queryForByte(String singleSelectPropName, long id) throws SQLException - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
-
queryForShort
default com.landawn.abacus.util.u.OptionalShort queryForShort(String singleSelectPropName, long id) throws SQLException - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
-
queryForInt
default com.landawn.abacus.util.u.OptionalInt queryForInt(String singleSelectPropName, long id) throws SQLException - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
-
queryForLong
default com.landawn.abacus.util.u.OptionalLong queryForLong(String singleSelectPropName, long id) throws SQLException - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
-
queryForFloat
default com.landawn.abacus.util.u.OptionalFloat queryForFloat(String singleSelectPropName, long id) throws SQLException - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
-
queryForDouble
default com.landawn.abacus.util.u.OptionalDouble queryForDouble(String singleSelectPropName, long id) throws SQLException - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
-
queryForString
default com.landawn.abacus.util.u.Nullable<String> queryForString(String singleSelectPropName, long id) throws SQLException - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
-
queryForDate
default com.landawn.abacus.util.u.Nullable<Date> queryForDate(String singleSelectPropName, long id) throws SQLException - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
-
queryForTime
default com.landawn.abacus.util.u.Nullable<Time> queryForTime(String singleSelectPropName, long id) throws SQLException - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
-
queryForTimestamp
default com.landawn.abacus.util.u.Nullable<Timestamp> queryForTimestamp(String singleSelectPropName, long id) throws SQLException - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
-
queryForBytes
default com.landawn.abacus.util.u.Nullable<byte[]> queryForBytes(String singleSelectPropName, long id) throws SQLException - Parameters:
singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
-
queryForSingleResult
default <V> com.landawn.abacus.util.u.Nullable<V> queryForSingleResult(Class<? extends V> targetValueClass, String singleSelectPropName, long id) throws SQLException - Type Parameters:
V
-- Parameters:
targetValueClass
-singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
-
queryForSingleNonNull
default <V> com.landawn.abacus.util.u.Optional<V> queryForSingleNonNull(Class<? extends V> targetValueClass, String singleSelectPropName, long id) throws SQLException - Type Parameters:
V
-- Parameters:
targetValueClass
-singleSelectPropName
-id
-- Returns:
- Throws:
SQLException
-
queryForSingleNonNull
@Beta default <V> com.landawn.abacus.util.u.Optional<V> queryForSingleNonNull(String singleSelectPropName, long id, Jdbc.RowMapper<? extends V> rowMapper) throws SQLException - Type Parameters:
V
-- Parameters:
singleSelectPropName
-id
-rowMapper
-- Returns:
- Throws:
SQLException
-
queryForUniqueResult
default <V> com.landawn.abacus.util.u.Nullable<V> queryForUniqueResult(Class<? extends V> targetValueClass, String singleSelectPropName, long id) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException - Type Parameters:
V
-- Parameters:
targetValueClass
-singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
SQLException
-
queryForUniqueNonNull
default <V> com.landawn.abacus.util.u.Optional<V> queryForUniqueNonNull(Class<? extends V> targetValueClass, String singleSelectPropName, long id) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException - Type Parameters:
V
-- Parameters:
targetValueClass
-singleSelectPropName
-id
-- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
SQLException
-
queryForUniqueNonNull
@Beta default <V> com.landawn.abacus.util.u.Optional<V> queryForUniqueNonNull(String singleSelectPropName, long id, Jdbc.RowMapper<? extends V> rowMapper) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException - Type Parameters:
V
-- Parameters:
singleSelectPropName
-id
-rowMapper
-- Returns:
- Throws:
com.landawn.abacus.exception.DuplicatedResultException
SQLException
-
get
Returns the record found by the specifiedid
or an emptyOptional
if no record is found.- Parameters:
id
-- Returns:
- Throws:
SQLException
-
get
default com.landawn.abacus.util.u.Optional<T> get(long id, Collection<String> selectPropNames) throws SQLException Returns the record found by the specifiedid
or an emptyOptional
if no record is found.- Parameters:
id
-selectPropNames
-- Returns:
- Throws:
SQLException
-
gett
Returns the record found by the specifiedid
ornull
if no record is found.- Parameters:
id
-- Returns:
- Throws:
SQLException
-
gett
Returns the record found by the specifiedid
ornull
if no record is found.- Parameters:
id
-selectPropNames
-- Returns:
- Throws:
SQLException
-
exists
- Parameters:
id
-- Returns:
- Throws:
SQLException
-
notExists
- Parameters:
id
-- Returns:
- Throws:
SQLException
-
update
- Parameters:
propName
-propValue
-id
-- Returns:
- Throws:
SQLException
-
update
- Parameters:
updateProps
-id
-- Returns:
- Throws:
SQLException
-
deleteById
- Parameters:
id
-- Returns:
- Throws:
SQLException
-