Interface Dao<T,SB extends com.landawn.abacus.util.SQLBuilder,TD extends Dao<T,SB,TD>>

Type Parameters:
T -
SB - SQLBuilder used to generate sql scripts. Only can be SQLBuilder.PSC/PAC/PLC
TD -
All Known Subinterfaces:
CrudDao<T,ID,SB,TD>, CrudDaoL<T,SB,TD>, NoUpdateCrudDao<T,ID,SB,TD>, NoUpdateCrudDaoL<T,SB,TD>, NoUpdateDao<T,SB,TD>, ReadOnlyCrudDao<T,ID,SB,TD>, ReadOnlyCrudDaoL<T,SB,TD>, ReadOnlyDao<T,SB,TD>, UncheckedCrudDao<T,ID,SB,TD>, UncheckedCrudDaoL<T,SB,TD>, UncheckedDao<T,SB,TD>, UncheckedNoUpdateCrudDao<T,ID,SB,TD>, UncheckedNoUpdateCrudDaoL<T,SB,TD>, UncheckedNoUpdateDao<T,SB,TD>, UncheckedReadOnlyCrudDao<T,ID,SB,TD>, UncheckedReadOnlyCrudDaoL<T,SB,TD>, UncheckedReadOnlyDao<T,SB,TD>

public interface Dao<T,SB extends com.landawn.abacus.util.SQLBuilder,TD extends Dao<T,SB,TD>>
Performance Tips:
  • Avoid unnecessary/repeated database calls.
  • Only fetch the columns you need or update the columns you want.
  • Index is the key point in a lot of database performance issues.

  • This interface is designed to share/manager SQL queries by Java APIs/methods with static parameter types and return type, while hiding the SQL scripts. It's a gift from nature and created by thoughts.
    Note: Setting parameters by 'ParametersSetter' or Retrieving result/record by 'ResultExtractor/BiResultExtractor/RowMapper/BiRowMapper' is not enabled at present.
  • The SQL operations/methods should be annotated with SQL scripts by @Select/@Insert/@Update/@Delete/@NamedSelect/@NamedInsert/@NamedUpdate/@NamedDelete.
  • The Order of the parameters in the method should be consistent with parameter order in SQL scripts for parameterized SQL. For named parameterized SQL, the parameters must be binded with names through @Bind, or Map/Entity with getter/setter methods.
  • SQL parameters can be set through input method parameters(by multiple parameters or a Collection, or a Map/Entity for named sql), or by JdbcUtil.ParametersSetter<PreparedQuery/PreparedCallabeQuery...>.
  • ResultExtractor/BiResultExtractor/RowMapper/BiRowMapper can be specified by the last parameter of the method.
  • The return type of the method must be same as the return type of ResultExtractor/BiResultExtractor if it's specified by the last parameter of the method.
  • The return type of update/delete operations only can int/Integer/long/Long/boolean/Boolean/void. If it's long/Long, PreparedQuery#largeUpdate() will be called, otherwise, PreparedQuery#update() will be called.
  • Remember declaring throws SQLException in the method.

  • Which underline PreparedQuery/PreparedCallableQuery method to call for SQL methods/operations annotated with @Select/@NamedSelect:
    • If ResultExtractor/BiResultExtractor is specified by the last parameter of the method, PreparedQuery#query(ResultExtractor/BiResultExtractor) will be called.
    • Or else if RowMapper/BiRowMapper is specified by the last parameter of the method:
      • If the return type of the method is List and one of below conditions is matched, PreparedQuery#list(RowMapper/BiRowMapper) will be called:
        • The return type of the method is raw List without parameterized type, and the method name doesn't start with "get"/"findFirst"/"findOne"/"findOnlyOne".
        • The last parameter type is raw RowMapper/BiRowMapper without parameterized type, and the method name doesn't start with "get"/"findFirst"/"findOne"/"findOnlyOne".
        • The return type of the method is generic List with parameterized type and The last parameter type is generic RowMapper/BiRowMapper with parameterized types, but They're not same.
      • Or else if the return type of the method is ExceptionalStream/Stream, PreparedQuery#stream(RowMapper/BiRowMapper) will be called.
      • Or else if the return type of the method is Optional, PreparedQuery#findFirst(RowMapper/BiRowMapper) will be called.
      • Or else, PreparedQuery#findFirst(RowMapper/BiRowMapper).orElse(N.defaultValueOf(returnType)) will be called.
    • Or else:
      • If the return type of the method is DataSet, PreparedQuery#query() will be called.
      • Or else if the return type of the method is ExceptionalStream/Stream, PreparedQuery#stream(Class) will be called.
      • Or else if the return type of the method is Map or Entity class with getter/setter methods, PreparedQuery#findFirst(Class).orElseNull() will be called.
      • Or else if the return type of the method is Optional:
        • If the value type of Optional is Map, or Entity class with getter/setter methods, or List, or Object[], PreparedQuery#findFirst(Class) will be called.
        • Or else, PreparedQuery#queryForSingleNonNull(Class) will be called.
      • Or else if the return type of the method is Nullable:
        • If the value type of Nullable is Map, or Entity class with getter/setter methods, or List, or Object[], PreparedQuery#findFirst(Class) will be called.
        • Or else, PreparedQuery#queryForSingleResult(Class) will be called.
      • Or else if the return type of the method is OptionalBoolean/Byte/.../Double, PreparedQuery#queryForBoolean/Byte/...Double() will called.
      • Or else if the return type of the method is List, and the method name doesn't start with "get"/"findFirst"/"findOne"/"findOnlyOne", PreparedQuery#list(Class) will be called.
      • Or else if the return type of the method is boolean/Boolean, and the method name starts with "exist"/"exists"/"notExist"/"notExists", PreparedQuery#exists() or PreparedQuery#notExists() will be called.
      • Or else, PreparedQuery#queryForSingleResult(Class).orElse(N.defaultValueOf(returnType) will be called.


    Here is a simple UserDao sample.
     
     public static interface UserDao extends JdbcUtil.CrudDao<User, Long, SQLBuilder.PSC> {
         &#064NamedInsert("INSERT INTO user (id, first_name, last_name, email) VALUES (:id, :firstName, :lastName, :email)")
         void insertWithId(User user) throws SQLException;
    
         &#064NamedUpdate("UPDATE user SET first_name = :firstName, last_name = :lastName WHERE id = :id")
         int updateFirstAndLastName(@Bind("firstName") String newFirstName, @Bind("lastName") String newLastName, @Bind("id") long id) throws SQLException;
    
         &#064NamedSelect("SELECT first_name, last_name FROM user WHERE id = :id")
         User getFirstAndLastNameBy(@Bind("id") long id) throws SQLException;
    
         &#064NamedSelect("SELECT id, first_name, last_name, email FROM user")
         Stream allUsers() throws SQLException;
     }
     
     
    Here is the generate way to work with transaction started by SQLExecutor.
     
     static final UserDao userDao = Dao.newInstance(UserDao.class, dataSource);
     ...
    
     final SQLTransaction tran = JdbcUtil.beginTransaction(dataSource, IsolationLevel.READ_COMMITTED);
    
     try {
          userDao.getById(id);
          userDao.update(...);
          // more...
    
          tran.commit();
     } finally {
          // The connection will be automatically closed after the transaction is committed or rolled back.
          tran.rollbackIfNotCommitted();
     }
     
     
  • See Also:
    • Method Details

      • dataSource

        DataSource dataSource()
        Returns:
      • sqlMapper

        com.landawn.abacus.util.SQLMapper sqlMapper()
        Returns:
      • targetEntityClass

        @Deprecated @Internal Class<T> targetEntityClass()
        Deprecated.
        for internal use only.
        Returns:
      • executor

        @Deprecated @Internal Executor executor()
        Deprecated.
        for internal use only.
      • asyncExecutor

        @Deprecated @Internal com.landawn.abacus.util.AsyncExecutor asyncExecutor()
        Deprecated.
        for internal use only.
      • prepareQuery

        @Beta default PreparedQuery prepareQuery(String query) throws SQLException
        Parameters:
        query -
        Returns:
        Throws:
        SQLException
      • prepareQuery

        @Beta default PreparedQuery prepareQuery(String query, boolean generateKeys) throws SQLException
        Parameters:
        query -
        generateKeys -
        Returns:
        Throws:
        SQLException
      • prepareQuery

        @Beta default PreparedQuery prepareQuery(String query, int[] returnColumnIndexes) throws SQLException
        Parameters:
        query -
        returnColumnIndexes -
        Returns:
        Throws:
        SQLException
      • prepareQuery

        @Beta default PreparedQuery prepareQuery(String query, String[] returnColumnNames) throws SQLException
        Parameters:
        query -
        returnColumnIndexes -
        Returns:
        Throws:
        SQLException
      • prepareQuery

        @Beta default PreparedQuery prepareQuery(String sql, com.landawn.abacus.util.Throwables.BiFunction<Connection,String,PreparedStatement,SQLException> stmtCreator) throws SQLException
        Parameters:
        sql -
        stmtCreator -
        Returns:
        Throws:
        SQLException
      • prepareQueryForBigResult

        @Beta default PreparedQuery prepareQueryForBigResult(String query) throws SQLException
        Parameters:
        query -
        Returns:
        Throws:
        SQLException
      • prepareNamedQuery

        @Beta default NamedQuery prepareNamedQuery(String namedQuery) throws SQLException
        Parameters:
        namedQuery -
        Returns:
        Throws:
        SQLException
      • prepareNamedQuery

        @Beta default NamedQuery prepareNamedQuery(String namedQuery, boolean generateKeys) throws SQLException
        Parameters:
        namedQuery -
        generateKeys -
        Returns:
        Throws:
        SQLException
      • prepareNamedQuery

        @Beta default NamedQuery prepareNamedQuery(String namedQuery, int[] returnColumnIndexes) throws SQLException
        Parameters:
        namedQuery -
        returnColumnIndexes -
        Returns:
        Throws:
        SQLException
      • prepareNamedQuery

        @Beta default NamedQuery prepareNamedQuery(String namedQuery, String[] returnColumnNames) throws SQLException
        Parameters:
        namedQuery -
        returnColumnNames -
        Returns:
        Throws:
        SQLException
      • prepareNamedQuery

        @Beta default NamedQuery prepareNamedQuery(String namedQuery, com.landawn.abacus.util.Throwables.BiFunction<Connection,String,PreparedStatement,SQLException> stmtCreator) throws SQLException
        Parameters:
        namedQuery -
        stmtCreator -
        Returns:
        Throws:
        SQLException
      • prepareNamedQuery

        @Beta default NamedQuery prepareNamedQuery(com.landawn.abacus.util.ParsedSql namedSql) throws SQLException
        Parameters:
        namedSql - the named query
        Returns:
        Throws:
        SQLException
      • prepareNamedQuery

        @Beta default NamedQuery prepareNamedQuery(com.landawn.abacus.util.ParsedSql namedSql, boolean generateKeys) throws SQLException
        Parameters:
        namedSql - the named query
        generateKeys -
        Returns:
        Throws:
        SQLException
      • prepareNamedQuery

        @Beta default NamedQuery prepareNamedQuery(com.landawn.abacus.util.ParsedSql namedQuery, int[] returnColumnIndexes) throws SQLException
        Parameters:
        namedQuery -
        returnColumnIndexes -
        Returns:
        Throws:
        SQLException
      • prepareNamedQuery

        @Beta default NamedQuery prepareNamedQuery(com.landawn.abacus.util.ParsedSql namedQuery, String[] returnColumnNames) throws SQLException
        Parameters:
        namedQuery -
        returnColumnNames -
        Returns:
        Throws:
        SQLException
      • prepareNamedQuery

        @Beta default NamedQuery prepareNamedQuery(com.landawn.abacus.util.ParsedSql namedSql, com.landawn.abacus.util.Throwables.BiFunction<Connection,String,PreparedStatement,SQLException> stmtCreator) throws SQLException
        Parameters:
        namedSql - the named query
        stmtCreator -
        Returns:
        Throws:
        SQLException
      • prepareNamedQueryForBigResult

        @Beta default NamedQuery prepareNamedQueryForBigResult(String namedQuery) throws SQLException
        Parameters:
        namedQuery -
        Returns:
        Throws:
        SQLException
      • prepareCallableQuery

        @Beta default PreparedCallableQuery prepareCallableQuery(String query) throws SQLException
        Parameters:
        query -
        Returns:
        Throws:
        SQLException
      • prepareCallableQuery

        @Beta default PreparedCallableQuery prepareCallableQuery(String sql, com.landawn.abacus.util.Throwables.BiFunction<Connection,String,CallableStatement,SQLException> stmtCreator) throws SQLException
        Parameters:
        sql -
        stmtCreator -
        Returns:
        Throws:
        SQLException
      • prepareQuery

        @Beta default PreparedQuery prepareQuery(com.landawn.abacus.condition.Condition cond) throws SQLException
        Prepare a select query by specified cond.
        query could be a select/insert/update/delete or other sql statement. If it's select by default if not specified.
        Parameters:
        cond -
        Returns:
        Throws:
        SQLException
      • prepareQuery

        @Beta default PreparedQuery prepareQuery(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond) throws SQLException
        Prepare a select query by specified selectPropNames and cond.
        query could be a select/insert/update/delete or other sql statement. If it's select by default if not specified.
        Parameters:
        selectPropNames -
        cond -
        Returns:
        Throws:
        SQLException
      • prepareQueryForBigResult

        @Beta default PreparedQuery prepareQueryForBigResult(com.landawn.abacus.condition.Condition cond) throws SQLException
        Prepare a big result select query by specified cond.
        query could be a select/insert/update/delete or other sql statement. If it's select by default if not specified.
        Parameters:
        cond -
        Returns:
        Throws:
        SQLException
      • prepareQueryForBigResult

        @Beta default PreparedQuery prepareQueryForBigResult(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond) throws SQLException
        Prepare a big result select query by specified selectPropNames and cond.
        query could be a select/insert/update/delete or other sql statement. If it's select by default if not specified.
        Parameters:
        selectPropNames -
        cond -
        Returns:
        Throws:
        SQLException
      • prepareNamedQuery

        @Beta default NamedQuery prepareNamedQuery(com.landawn.abacus.condition.Condition cond) throws SQLException
        Prepare a select query by specified cond.
        query could be a select/insert/update/delete or other sql statement. If it's select by default if not specified.
        Parameters:
        cond -
        Returns:
        Throws:
        SQLException
      • prepareNamedQuery

        @Beta default NamedQuery prepareNamedQuery(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond) throws SQLException
        Prepare a select query by specified selectPropNames and cond.
        query could be a select/insert/update/delete or other sql statement. If it's select by default if not specified.
        Parameters:
        selectPropNames -
        cond -
        Returns:
        Throws:
        SQLException
      • prepareNamedQueryForBigResult

        @Beta default NamedQuery prepareNamedQueryForBigResult(com.landawn.abacus.condition.Condition cond) throws SQLException
        Prepare a big result select query by specified cond.
        query could be a select/insert/update/delete or other sql statement. If it's select by default if not specified.
        Parameters:
        cond -
        Returns:
        Throws:
        SQLException
      • prepareNamedQueryForBigResult

        @Beta default NamedQuery prepareNamedQueryForBigResult(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond) throws SQLException
        Prepare a big result select query by specified selectPropNames and cond.
        query could be a select/insert/update/delete or other sql statement. If it's select by default if not specified.
        Parameters:
        selectPropNames -
        cond -
        Returns:
        Throws:
        SQLException
      • save

        void save(T entityToSave) throws SQLException
        Parameters:
        entityToSave -
        Throws:
        SQLException
      • save

        void save(T entityToSave, Collection<String> propNamesToSave) throws SQLException
        Parameters:
        entityToSave -
        propNamesToSave -
        Throws:
        SQLException
      • save

        void save(String namedInsertSQL, T entityToSave) throws SQLException
        Parameters:
        namedInsertSQL -
        entityToSave -
        Throws:
        SQLException
      • batchSave

        default void batchSave(Collection<? extends T> entitiesToSave) throws SQLException
        Insert the specified entities to database by batch.
        Parameters:
        entitiesToSave -
        Throws:
        SQLException
        See Also:
      • batchSave

        void batchSave(Collection<? extends T> entitiesToSave, int batchSize) throws SQLException
        Insert the specified entities to database by batch.
        Parameters:
        entitiesToSave -
        batchSize -
        Throws:
        SQLException
        See Also:
      • batchSave

        default void batchSave(Collection<? extends T> entitiesToSave, Collection<String> propNamesToSave) throws SQLException
        Insert the specified entities to database by batch.
        Parameters:
        entitiesToSave -
        propNamesToSave -
        Throws:
        SQLException
        See Also:
      • batchSave

        void batchSave(Collection<? extends T> entitiesToSave, Collection<String> propNamesToSave, int batchSize) throws SQLException
        Insert the specified entities to database by batch.
        Parameters:
        entitiesToSave -
        propNamesToSave -
        batchSize -
        Throws:
        SQLException
        See Also:
      • batchSave

        @Beta default void batchSave(String namedInsertSQL, Collection<? extends T> entitiesToSave) throws SQLException
        Insert the specified entities to database by batch.
        Parameters:
        namedInsertSQL -
        entitiesToSave -
        Throws:
        SQLException
        See Also:
      • batchSave

        @Beta void batchSave(String namedInsertSQL, Collection<? extends T> entitiesToSave, int batchSize) throws SQLException
        Insert the specified entities to database by batch.
        Parameters:
        namedInsertSQL -
        entitiesToSave -
        batchSize -
        Throws:
        SQLException
        See Also:
      • exists

        boolean exists(com.landawn.abacus.condition.Condition cond) throws SQLException
        Parameters:
        cond -
        Returns:
        true, if there is at least one record found.
        Throws:
        SQLException
        See Also:
      • notExists

        @Beta default boolean notExists(com.landawn.abacus.condition.Condition cond) throws SQLException
        Parameters:
        cond -
        Returns:
        true, if there is no record found.
        Throws:
        SQLException
        See Also:
      • count

        int count(com.landawn.abacus.condition.Condition cond) throws SQLException
        Parameters:
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • findFirst

        com.landawn.abacus.util.u.Optional<T> findFirst(com.landawn.abacus.condition.Condition cond) throws SQLException
        Parameters:
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • findFirst

        <R> com.landawn.abacus.util.u.Optional<R> findFirst(com.landawn.abacus.condition.Condition cond, Jdbc.RowMapper<? extends R> rowMapper) throws SQLException, NullPointerException
        Parameters:
        cond -
        rowMapper -
        Returns:
        Throws:
        SQLException
        NullPointerException - if rowMapper returns null for the found record.
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • findFirst

        <R> com.landawn.abacus.util.u.Optional<R> findFirst(com.landawn.abacus.condition.Condition cond, Jdbc.BiRowMapper<? extends R> rowMapper) throws SQLException, NullPointerException
        Parameters:
        cond -
        rowMapper -
        Returns:
        Throws:
        SQLException
        NullPointerException - if rowMapper returns null for the found record.
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • findFirst

        com.landawn.abacus.util.u.Optional<T> findFirst(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond) throws SQLException
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • findFirst

        <R> com.landawn.abacus.util.u.Optional<R> findFirst(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.RowMapper<? extends R> rowMapper) throws SQLException, NullPointerException
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        rowMapper -
        Returns:
        Throws:
        SQLException
        NullPointerException - if rowMapper returns null for the found record.
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • findFirst

        <R> com.landawn.abacus.util.u.Optional<R> findFirst(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.BiRowMapper<? extends R> rowMapper) throws SQLException, NullPointerException
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        rowMapper -
        Returns:
        Throws:
        SQLException
        NullPointerException - if rowMapper returns null for the found record.
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • findOnlyOne

        com.landawn.abacus.util.u.Optional<T> findOnlyOne(com.landawn.abacus.condition.Condition cond) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException
        Parameters:
        cond -
        Returns:
        Throws:
        com.landawn.abacus.exception.DuplicatedResultException - if more than one record found by the specified id (or condition).
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • findOnlyOne

        <R> com.landawn.abacus.util.u.Optional<R> findOnlyOne(com.landawn.abacus.condition.Condition cond, Jdbc.RowMapper<? extends R> rowMapper) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException, NullPointerException
        Parameters:
        cond -
        rowMapper -
        Returns:
        Throws:
        com.landawn.abacus.exception.DuplicatedResultException - if more than one record found by the specified id (or condition).
        SQLException
        NullPointerException - if rowMapper returns null for the found record.
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • findOnlyOne

        <R> com.landawn.abacus.util.u.Optional<R> findOnlyOne(com.landawn.abacus.condition.Condition cond, Jdbc.BiRowMapper<? extends R> rowMapper) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException, NullPointerException
        Parameters:
        cond -
        rowMapper -
        Returns:
        Throws:
        com.landawn.abacus.exception.DuplicatedResultException - if more than one record found by the specified id (or condition).
        SQLException
        NullPointerException - if rowMapper returns null for the found record.
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • findOnlyOne

        com.landawn.abacus.util.u.Optional<T> findOnlyOne(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        Returns:
        Throws:
        com.landawn.abacus.exception.DuplicatedResultException - if more than one record found by the specified id (or condition).
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • findOnlyOne

        <R> com.landawn.abacus.util.u.Optional<R> findOnlyOne(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.RowMapper<? extends R> rowMapper) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException, NullPointerException
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        rowMapper -
        Returns:
        Throws:
        com.landawn.abacus.exception.DuplicatedResultException - if more than one record found by the specified id (or condition).
        SQLException
        NullPointerException - if rowMapper returns null for the found record.
      • findOnlyOne

        <R> com.landawn.abacus.util.u.Optional<R> findOnlyOne(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.BiRowMapper<? extends R> rowMapper) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException, NullPointerException
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        rowMapper -
        Returns:
        Throws:
        com.landawn.abacus.exception.DuplicatedResultException - if more than one record found by the specified id (or condition).
        SQLException
        NullPointerException - if rowMapper returns null for the found record.
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForBoolean

        com.landawn.abacus.util.u.OptionalBoolean queryForBoolean(String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws SQLException
        Query for boolean.
        Parameters:
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForChar

        com.landawn.abacus.util.u.OptionalChar queryForChar(String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws SQLException
        Query for char.
        Parameters:
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForByte

        com.landawn.abacus.util.u.OptionalByte queryForByte(String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws SQLException
        Query for byte.
        Parameters:
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForShort

        com.landawn.abacus.util.u.OptionalShort queryForShort(String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws SQLException
        Query for short.
        Parameters:
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForInt

        com.landawn.abacus.util.u.OptionalInt queryForInt(String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws SQLException
        Query for int.
        Parameters:
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForLong

        com.landawn.abacus.util.u.OptionalLong queryForLong(String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws SQLException
        Query for long.
        Parameters:
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForFloat

        com.landawn.abacus.util.u.OptionalFloat queryForFloat(String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws SQLException
        Query for float.
        Parameters:
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForDouble

        com.landawn.abacus.util.u.OptionalDouble queryForDouble(String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws SQLException
        Query for double.
        Parameters:
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForString

        com.landawn.abacus.util.u.Nullable<String> queryForString(String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws SQLException
        Query for string.
        Parameters:
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForDate

        com.landawn.abacus.util.u.Nullable<Date> queryForDate(String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws SQLException
        Query for date.
        Parameters:
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForTime

        com.landawn.abacus.util.u.Nullable<Time> queryForTime(String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws SQLException
        Query for time.
        Parameters:
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForTimestamp

        com.landawn.abacus.util.u.Nullable<Timestamp> queryForTimestamp(String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws SQLException
        Query for timestamp.
        Parameters:
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForBytes

        com.landawn.abacus.util.u.Nullable<byte[]> queryForBytes(String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws SQLException
        Query for byte[].
        Parameters:
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForSingleResult

        <V> com.landawn.abacus.util.u.Nullable<V> queryForSingleResult(Class<? extends V> targetValueClass, String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws SQLException
        Query for single result.
        Type Parameters:
        V - the value type
        Parameters:
        targetValueClass -
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForSingleNonNull

        <V> com.landawn.abacus.util.u.Optional<V> queryForSingleNonNull(Class<? extends V> targetValueClass, String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws SQLException
        Query for single non null.
        Type Parameters:
        V - the value type
        Parameters:
        targetValueClass -
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        com.landawn.abacus.exception.DuplicatedResultException - if more than one record found by the specified id (or condition).
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForUniqueResult

        <V> com.landawn.abacus.util.u.Nullable<V> queryForUniqueResult(Class<? extends V> targetValueClass, String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException
        Query for unique result.
        Type Parameters:
        V - the value type
        Parameters:
        targetValueClass -
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        com.landawn.abacus.exception.DuplicatedResultException - if more than one record found by the specified id (or condition).
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • queryForUniqueNonNull

        <V> com.landawn.abacus.util.u.Optional<V> queryForUniqueNonNull(Class<? extends V> targetValueClass, String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws com.landawn.abacus.exception.DuplicatedResultException, SQLException
        Query for unique non null.
        Type Parameters:
        V - the value type
        Parameters:
        targetValueClass -
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        SQLException
        com.landawn.abacus.exception.DuplicatedResultException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • query

        com.landawn.abacus.util.DataSet query(com.landawn.abacus.condition.Condition cond) throws SQLException
        Parameters:
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • query

        com.landawn.abacus.util.DataSet query(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond) throws SQLException
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • query

        <R> R query(com.landawn.abacus.condition.Condition cond, Jdbc.ResultExtractor<? extends R> resultExtractor) throws SQLException
        Parameters:
        cond -
        resultExtractor - Don't save/return ResultSet. It will be closed after this call.
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • query

        <R> R query(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.ResultExtractor<? extends R> resultExtractor) throws SQLException
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        resultExtractor - Don't save/return ResultSet. It will be closed after this call.
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • query

        <R> R query(com.landawn.abacus.condition.Condition cond, Jdbc.BiResultExtractor<? extends R> resultExtractor) throws SQLException
        Parameters:
        cond -
        resultExtractor - Don't save/return ResultSet. It will be closed after this call.
        Returns:
        Throws:
        SQLException
      • query

        <R> R query(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.BiResultExtractor<? extends R> resultExtractor) throws SQLException
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        resultExtractor - Don't save/return ResultSet. It will be closed after this call.
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • list

        List<T> list(com.landawn.abacus.condition.Condition cond) throws SQLException
        Parameters:
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • list

        <R> List<R> list(com.landawn.abacus.condition.Condition cond, Jdbc.RowMapper<? extends R> rowMapper) throws SQLException
        Parameters:
        cond -
        rowMapper -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • list

        <R> List<R> list(com.landawn.abacus.condition.Condition cond, Jdbc.BiRowMapper<? extends R> rowMapper) throws SQLException
        Parameters:
        cond -
        rowMapper -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • list

        <R> List<R> list(com.landawn.abacus.condition.Condition cond, Jdbc.RowFilter rowFilter, Jdbc.RowMapper<? extends R> rowMapper) throws SQLException
        Parameters:
        cond -
        rowFilter -
        rowMapper -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • list

        <R> List<R> list(com.landawn.abacus.condition.Condition cond, Jdbc.BiRowFilter rowFilter, Jdbc.BiRowMapper<? extends R> rowMapper) throws SQLException
        Parameters:
        cond -
        rowFilter -
        rowMapper -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • list

        List<T> list(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond) throws SQLException
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • list

        <R> List<R> list(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.RowMapper<? extends R> rowMapper) throws SQLException
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        rowMapper -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • list

        <R> List<R> list(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.BiRowMapper<? extends R> rowMapper) throws SQLException
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        rowMapper -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • list

        <R> List<R> list(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.RowFilter rowFilter, Jdbc.RowMapper<? extends R> rowMapper) throws SQLException
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        rowFilter -
        rowMapper -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • list

        <R> List<R> list(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.BiRowFilter rowFilter, Jdbc.BiRowMapper<? extends R> rowMapper) throws SQLException
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        rowFilter -
        rowMapper -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • list

        default <R> List<R> list(String singleSelectPropName, com.landawn.abacus.condition.Condition cond) throws SQLException
        Parameters:
        singleSelectPropName -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • list

        default <R> List<R> list(String singleSelectPropName, com.landawn.abacus.condition.Condition cond, Jdbc.RowMapper<? extends R> rowMapper) throws SQLException
        Parameters:
        singleSelectPropName -
        cond -
        rowMapper -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • list

        default <R> List<R> list(String singleSelectPropName, com.landawn.abacus.condition.Condition cond, Jdbc.RowFilter rowFilter, Jdbc.RowMapper<? extends R> rowMapper) throws SQLException
        Parameters:
        singleSelectPropName -
        cond -
        rowFilter -
        rowMapper -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • stream

        com.landawn.abacus.util.ExceptionalStream<T,SQLException> stream(com.landawn.abacus.condition.Condition cond)
        Lazy execution, lazy fetching. No connection fetching/creating, no statement preparing or execution, no result fetching until @TerminalOp or @TerminalOpTriggered stream operation is called.
        Parameters:
        cond -
        Returns:
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • stream

        <R> com.landawn.abacus.util.ExceptionalStream<R,SQLException> stream(com.landawn.abacus.condition.Condition cond, Jdbc.RowMapper<? extends R> rowMapper)
        lazy-execution, lazy-fetch.
        Parameters:
        cond -
        rowMapper -
        Returns:
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • stream

        <R> com.landawn.abacus.util.ExceptionalStream<R,SQLException> stream(com.landawn.abacus.condition.Condition cond, Jdbc.BiRowMapper<? extends R> rowMapper)
        Lazy execution, lazy fetching. No connection fetching/creating, no statement preparing or execution, no result fetching until @TerminalOp or @TerminalOpTriggered stream operation is called.
        Parameters:
        cond -
        rowMapper -
        Returns:
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • stream

        <R> com.landawn.abacus.util.ExceptionalStream<R,SQLException> stream(com.landawn.abacus.condition.Condition cond, Jdbc.RowFilter rowFilter, Jdbc.RowMapper<? extends R> rowMapper)
        Lazy execution, lazy fetching. No connection fetching/creating, no statement preparing or execution, no result fetching until @TerminalOp or @TerminalOpTriggered stream operation is called.
        Parameters:
        cond -
        rowFilter -
        rowMapper -
        Returns:
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • stream

        <R> com.landawn.abacus.util.ExceptionalStream<R,SQLException> stream(com.landawn.abacus.condition.Condition cond, Jdbc.BiRowFilter rowFilter, Jdbc.BiRowMapper<? extends R> rowMapper)
        Lazy execution, lazy fetching. No connection fetching/creating, no statement preparing or execution, no result fetching until @TerminalOp or @TerminalOpTriggered stream operation is called.
        Parameters:
        cond -
        rowFilter -
        rowMapper -
        Returns:
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • stream

        com.landawn.abacus.util.ExceptionalStream<T,SQLException> stream(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond)
        Lazy execution, lazy fetching. No connection fetching/creating, no statement preparing or execution, no result fetching until @TerminalOp or @TerminalOpTriggered stream operation is called.
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        Returns:
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • stream

        <R> com.landawn.abacus.util.ExceptionalStream<R,SQLException> stream(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.RowMapper<? extends R> rowMapper)
        Lazy execution, lazy fetching. No connection fetching/creating, no statement preparing or execution, no result fetching until @TerminalOp or @TerminalOpTriggered stream operation is called.
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        rowMapper -
        Returns:
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • stream

        <R> com.landawn.abacus.util.ExceptionalStream<R,SQLException> stream(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.BiRowMapper<? extends R> rowMapper)
        Lazy execution, lazy fetching. No connection fetching/creating, no statement preparing or execution, no result fetching until @TerminalOp or @TerminalOpTriggered stream operation is called.
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        rowMapper -
        Returns:
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • stream

        <R> com.landawn.abacus.util.ExceptionalStream<R,SQLException> stream(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.RowFilter rowFilter, Jdbc.RowMapper<? extends R> rowMapper)
        Lazy execution, lazy fetching. No connection fetching/creating, no statement preparing or execution, no result fetching until @TerminalOp or @TerminalOpTriggered stream operation is called.
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        rowFilter -
        rowMapper -
        Returns:
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • stream

        <R> com.landawn.abacus.util.ExceptionalStream<R,SQLException> stream(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.BiRowFilter rowFilter, Jdbc.BiRowMapper<? extends R> rowMapper)
        Lazy execution, lazy fetching. No connection fetching/creating, no statement preparing or execution, no result fetching until @TerminalOp or @TerminalOpTriggered stream operation is called.
        Parameters:
        selectPropNames - all properties(columns) will be selected, excluding the properties of joining entities, if the specified selectPropNames is null.
        cond -
        rowFilter -
        rowMapper -
        Returns:
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • stream

        default <R> com.landawn.abacus.util.ExceptionalStream<R,SQLException> stream(String singleSelectPropName, com.landawn.abacus.condition.Condition cond)
        Lazy execution, lazy fetching. No connection fetching/creating, no statement preparing or execution, no result fetching until @TerminalOp or @TerminalOpTriggered stream operation is called.
        Parameters:
        singleSelectPropName -
        cond -
        Returns:
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • stream

        default <R> com.landawn.abacus.util.ExceptionalStream<R,SQLException> stream(String singleSelectPropName, com.landawn.abacus.condition.Condition cond, Jdbc.RowMapper<? extends R> rowMapper)
        Lazy execution, lazy fetching. No connection fetching/creating, no statement preparing or execution, no result fetching until @TerminalOp or @TerminalOpTriggered stream operation is called.
        Parameters:
        singleSelectPropName -
        cond -
        rowMapper -
        Returns:
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • stream

        default <R> com.landawn.abacus.util.ExceptionalStream<R,SQLException> stream(String singleSelectPropName, com.landawn.abacus.condition.Condition cond, Jdbc.RowFilter rowFilter, Jdbc.RowMapper<? extends R> rowMapper)
        Lazy execution, lazy fetching. No connection fetching/creating, no statement preparing or execution, no result fetching until @TerminalOp or @TerminalOpTriggered stream operation is called.
        Parameters:
        singleSelectPropName -
        cond -
        rowMapper -
        Returns:
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • forEach

        void forEach(com.landawn.abacus.condition.Condition cond, Jdbc.RowConsumer rowConsumer) throws SQLException
        Parameters:
        cond -
        rowConsumer -
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • forEach

        void forEach(com.landawn.abacus.condition.Condition cond, Jdbc.BiRowConsumer rowConsumer) throws SQLException
        Parameters:
        cond -
        rowConsumer -
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • forEach

        void forEach(com.landawn.abacus.condition.Condition cond, Jdbc.RowFilter rowFilter, Jdbc.RowConsumer rowConsumer) throws SQLException
        Parameters:
        cond -
        rowFilter -
        rowConsumer -
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • forEach

        void forEach(com.landawn.abacus.condition.Condition cond, Jdbc.BiRowFilter rowFilter, Jdbc.BiRowConsumer rowConsumer) throws SQLException
        Parameters:
        cond -
        rowFilter -
        rowConsumer -
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • forEach

        void forEach(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.RowConsumer rowConsumer) throws SQLException
        Parameters:
        selectPropNames -
        cond -
        rowConsumer -
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • forEach

        void forEach(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.BiRowConsumer rowConsumer) throws SQLException
        Parameters:
        selectPropNames -
        cond -
        rowConsumer -
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • forEach

        void forEach(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.RowFilter rowFilter, Jdbc.RowConsumer rowConsumer) throws SQLException
        Parameters:
        selectPropNames -
        cond -
        rowFilter -
        rowConsumer -
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • forEach

        void forEach(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Jdbc.BiRowFilter rowFilter, Jdbc.BiRowConsumer rowConsumer) throws SQLException
        Parameters:
        selectPropNames -
        cond -
        rowFilter -
        rowConsumer -
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • foreach

        @Beta default void foreach(Collection<String> selectPropNames, com.landawn.abacus.condition.Condition cond, Consumer<com.landawn.abacus.util.NoCachingNoUpdating.DisposableObjArray> rowConsumer) throws SQLException
        Parameters:
        selectPropNames -
        cond -
        rowConsumer -
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • foreach

        @Beta default void foreach(com.landawn.abacus.condition.Condition cond, Consumer<com.landawn.abacus.util.NoCachingNoUpdating.DisposableObjArray> rowConsumer) throws SQLException
        Parameters:
        cond -
        rowConsumer -
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • update

        default int update(String propName, Object propValue, com.landawn.abacus.condition.Condition cond) throws SQLException
        Parameters:
        propName -
        propValue -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • update

        int update(Map<String,Object> updateProps, com.landawn.abacus.condition.Condition cond) throws SQLException
        Update all the records found by specified cond with all the properties from specified updateProps.
        Parameters:
        updateProps -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • update

        default int update(T entity, com.landawn.abacus.condition.Condition cond) throws SQLException
        Update all the records found by specified cond with the properties from specified entity.
        Parameters:
        entity -
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • update

        int update(T entity, Collection<String> propNamesToUpdate, com.landawn.abacus.condition.Condition cond) throws SQLException
        Update all the records found by specified cond with specified propNamesToUpdate from specified entity.
        Parameters:
        entity -
        cond -
        propNamesToUpdate -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • upsert

        default T upsert(T entity, com.landawn.abacus.condition.Condition cond) throws SQLException
        Execute add and return the added entity if the record doesn't, otherwise, update is executed and updated db record is returned.
        Parameters:
        entity -
        cond - to verify if the record exists or not.
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • delete

        int delete(com.landawn.abacus.condition.Condition cond) throws SQLException
        Parameters:
        cond -
        Returns:
        Throws:
        SQLException
        See Also:
        • ConditionFactory
        • ConditionFactory.CF
      • asyncCall

        @Beta default <R> com.landawn.abacus.util.ContinuableFuture<R> asyncCall(com.landawn.abacus.util.Throwables.Function<TD,R,SQLException> sqlAction)
        Any transaction started in current thread won't be automatically applied to specified sqlAction which will be executed in another thread.
        Type Parameters:
        R -
        Parameters:
        sqlAction -
        Returns:
      • asyncCall

        @Beta default <R> com.landawn.abacus.util.ContinuableFuture<R> asyncCall(com.landawn.abacus.util.Throwables.Function<TD,R,SQLException> sqlAction, Executor executor)
        Any transaction started in current thread won't be automatically applied to specified sqlAction which will be executed in another thread.
        Type Parameters:
        R -
        Parameters:
        sqlAction -
        executor -
        Returns:
      • asyncRun

        @Beta default com.landawn.abacus.util.ContinuableFuture<Void> asyncRun(com.landawn.abacus.util.Throwables.Consumer<TD,SQLException> sqlAction)
        Any transaction started in current thread won't be automatically applied to specified sqlAction which will be executed in another thread.
        Parameters:
        sqlAction -
        Returns:
      • asyncRun

        @Beta default com.landawn.abacus.util.ContinuableFuture<Void> asyncRun(com.landawn.abacus.util.Throwables.Consumer<TD,SQLException> sqlAction, Executor executor)
        Any transaction started in current thread won't be automatically applied to specified sqlAction which will be executed in another thread.
        Parameters:
        sqlAction -
        executor -
        Returns: