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

Type Parameters:
T -
ID - use Void if there is no id defined/annotated with @Id in target entity class T.
SB - SQLBuilder used to generate sql scripts. Only can be SQLBuilder.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:
  • Method Details

    • generateId

      @Deprecated default ID generateId() throws UnsupportedOperationException, com.landawn.abacus.exception.UncheckedSQLException
      Deprecated.
      unsupported Operation
      Specified by:
      generateId in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Returns:
      Throws:
      UnsupportedOperationException
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • insert

      ID insert(T entityToInsert) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      insert in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entityToInsert -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • insert

      ID insert(T entityToInsert, Collection<String> propNamesToInsert) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      insert in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entityToInsert -
      propNamesToInsert -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • insert

      ID insert(String namedInsertSQL, T entityToInsert) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      insert in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      namedInsertSQL -
      entityToInsert -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchInsert

      default List<ID> batchInsert(Collection<? extends T> entities) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchInsert in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entities -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchInsert

      List<ID> batchInsert(Collection<? extends T> entities, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchInsert in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entities -
      batchSize -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchInsert

      default List<ID> batchInsert(Collection<? extends T> entities, Collection<String> propNamesToInsert) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchInsert in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entities -
      propNamesToInsert -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchInsert

      List<ID> batchInsert(Collection<? extends T> entities, Collection<String> propNamesToInsert, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchInsert in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entities -
      propNamesToInsert -
      batchSize -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchInsert

      @Beta default List<ID> batchInsert(String namedInsertSQL, Collection<? extends T> entities) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchInsert in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      namedInsertSQL -
      entities -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchInsert

      @Beta List<ID> batchInsert(String namedInsertSQL, Collection<? extends T> entities, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchInsert in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      namedInsertSQL -
      entities -
      batchSize -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • queryForBoolean

      com.landawn.abacus.util.u.OptionalBoolean queryForBoolean(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Query for boolean.
      Specified by:
      queryForBoolean in interface CrudDao<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:
      • IDFactory
      • IDFactory.CF
    • queryForChar

      com.landawn.abacus.util.u.OptionalChar queryForChar(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Query for char.
      Specified by:
      queryForChar in interface CrudDao<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:
      • IDFactory
      • IDFactory.CF
    • queryForByte

      com.landawn.abacus.util.u.OptionalByte queryForByte(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Query for byte.
      Specified by:
      queryForByte in interface CrudDao<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:
      • IDFactory
      • IDFactory.CF
    • queryForShort

      com.landawn.abacus.util.u.OptionalShort queryForShort(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Query for short.
      Specified by:
      queryForShort in interface CrudDao<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:
      • IDFactory
      • IDFactory.CF
    • queryForInt

      com.landawn.abacus.util.u.OptionalInt queryForInt(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Query for int.
      Specified by:
      queryForInt in interface CrudDao<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:
      • IDFactory
      • IDFactory.CF
    • queryForLong

      com.landawn.abacus.util.u.OptionalLong queryForLong(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Query for long.
      Specified by:
      queryForLong in interface CrudDao<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:
      • IDFactory
      • IDFactory.CF
    • queryForFloat

      com.landawn.abacus.util.u.OptionalFloat queryForFloat(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Query for float.
      Specified by:
      queryForFloat in interface CrudDao<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:
      • IDFactory
      • IDFactory.CF
    • queryForDouble

      com.landawn.abacus.util.u.OptionalDouble queryForDouble(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Query for double.
      Specified by:
      queryForDouble in interface CrudDao<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:
      • IDFactory
      • IDFactory.CF
    • queryForString

      com.landawn.abacus.util.u.Nullable<String> queryForString(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Query for string.
      Specified by:
      queryForString in interface CrudDao<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:
      • IDFactory
      • IDFactory.CF
    • queryForDate

      com.landawn.abacus.util.u.Nullable<Date> queryForDate(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Query for date.
      Specified by:
      queryForDate in interface CrudDao<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:
      • IDFactory
      • IDFactory.CF
    • queryForTime

      com.landawn.abacus.util.u.Nullable<Time> queryForTime(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Query for time.
      Specified by:
      queryForTime in interface CrudDao<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:
      • IDFactory
      • IDFactory.CF
    • queryForTimestamp

      com.landawn.abacus.util.u.Nullable<Timestamp> queryForTimestamp(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Query for timestamp.
      Specified by:
      queryForTimestamp in interface CrudDao<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:
      • IDFactory
      • IDFactory.CF
    • queryForBytes

      com.landawn.abacus.util.u.Nullable<byte[]> queryForBytes(String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Query for byte[].
      Specified by:
      queryForBytes in interface CrudDao<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:
      • IDFactory
      • IDFactory.CF
    • queryForSingleResult

      <V> com.landawn.abacus.util.u.Nullable<V> queryForSingleResult(Class<? extends V> targetValueClass, String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Query for single result.
      Specified by:
      queryForSingleResult in interface CrudDao<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:
      • IDFactory
      • IDFactory.CF
    • queryForSingleNonNull

      <V> com.landawn.abacus.util.u.Optional<V> queryForSingleNonNull(Class<? extends V> targetValueClass, String singleSelectPropName, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Query for single non null.
      Specified by:
      queryForSingleNonNull in interface CrudDao<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 specified id (or idition).
      com.landawn.abacus.exception.UncheckedSQLException
      See Also:
      • IDFactory
      • IDFactory.CF
    • 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
      Query for unique result.
      Specified by:
      queryForUniqueResult in interface CrudDao<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 specified id (or idition).
      com.landawn.abacus.exception.UncheckedSQLException
      See Also:
      • IDFactory
      • IDFactory.CF
    • 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
      Query for unique non null.
      Specified by:
      queryForUniqueNonNull in interface CrudDao<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
      com.landawn.abacus.exception.DuplicatedResultException
      See Also:
      • IDFactory
      • IDFactory.CF
    • get

      default com.landawn.abacus.util.u.Optional<T> get(ID id) throws com.landawn.abacus.exception.DuplicatedResultException, com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      get in interface CrudDao<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 specified id (or condition).
      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
      Specified by:
      get in interface CrudDao<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 specified selectPropNames is null.
      Returns:
      Throws:
      com.landawn.abacus.exception.DuplicatedResultException - if more than one record found by the specified id (or condition).
      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
      Specified by:
      gett in interface CrudDao<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 specified id (or condition).
      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
      Specified by:
      gett in interface CrudDao<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 specified selectPropNames is null.
      Returns:
      Throws:
      com.landawn.abacus.exception.DuplicatedResultException - if more than one record found by the specified id (or condition).
      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 interface CrudDao<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 input ids.
      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 interface CrudDao<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 input ids.
      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 interface CrudDao<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 specified selectPropNames is null.
      Returns:
      Throws:
      com.landawn.abacus.exception.DuplicatedResultException - if the size of result is bigger than the size of input ids.
      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 interface CrudDao<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 specified selectPropNames is null.
      batchSize -
      Returns:
      Throws:
      com.landawn.abacus.exception.DuplicatedResultException - if the size of result is bigger than the size of input ids.
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • exists

      boolean exists(ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      exists in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      id -
      Returns:
      true, if successful
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
      See Also:
    • notExists

      @Beta default boolean notExists(ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      notExists in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      id -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException
      See Also:
    • 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 input ids.
      Specified by:
      count in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      ids -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • update

      int update(T entityToUpdate) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      update in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entityToUpdate -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • update

      int update(T entityToUpdate, Collection<String> propNamesToUpdate) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      update in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entityToUpdate -
      propNamesToUpdate -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • update

      default int update(String propName, Object propValue, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      update in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      propName -
      propValue -
      id -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • update

      int update(Map<String,Object> updateProps, ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      update in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      updateProps -
      id -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchUpdate

      default int batchUpdate(Collection<? extends T> entities) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchUpdate in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entities -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchUpdate

      int batchUpdate(Collection<? extends T> entities, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchUpdate in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entities -
      batchSize -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchUpdate

      default int batchUpdate(Collection<? extends T> entities, Collection<String> propNamesToUpdate) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchUpdate in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entities -
      propNamesToUpdate -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchUpdate

      int batchUpdate(Collection<? extends T> entities, Collection<String> propNamesToUpdate, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchUpdate in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entities -
      propNamesToUpdate -
      batchSize -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • upsert

      default T upsert(T entity, com.landawn.abacus.condition.Condition cond) throws com.landawn.abacus.exception.UncheckedSQLException
      Execute add and return the added entity if the record doesn't, otherwise, update is executed and updated db record is returned.
      Specified by:
      upsert in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Specified by:
      upsert in interface Dao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder>
      Specified by:
      upsert in interface UncheckedDao<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
    • upsert

      default T upsert(T entity) throws com.landawn.abacus.exception.UncheckedSQLException
      Execute add and return the added entity if the record doesn't, otherwise, update is executed and updated db record is returned.
      Specified by:
      upsert in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entity -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchUpsert

      default List<T> batchUpsert(Collection<? extends T> entities) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchUpsert in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entities -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchUpsert

      default List<T> batchUpsert(Collection<? extends T> entities, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchUpsert in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entities -
      batchSize -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • refresh

      default boolean refresh(T entity) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      refresh in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entity -
      Returns:
      true, if successful
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • refresh

      default boolean refresh(T entity, Collection<String> propNamesToRefresh) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      refresh in interface CrudDao<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 specified entity.
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchRefresh

      default int batchRefresh(Collection<? extends T> entities) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchRefresh in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entities -
      Returns:
      the count of refreshed entities.
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchRefresh

      default int batchRefresh(Collection<? extends T> entities, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchRefresh in interface CrudDao<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 interface CrudDao<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 interface CrudDao<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

      int delete(T entity) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      delete in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entity -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • deleteById

      int deleteById(ID id) throws com.landawn.abacus.exception.UncheckedSQLException
      Delete by id.
      Specified by:
      deleteById in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      id -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchDelete

      default int batchDelete(Collection<? extends T> entities) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchDelete in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entities -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchDelete

      int batchDelete(Collection<? extends T> entities, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchDelete in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      entities -
      batchSize -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchDeleteByIds

      default int batchDeleteByIds(Collection<? extends ID> ids) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchDeleteByIds in interface CrudDao<T,ID,SB extends com.landawn.abacus.util.SQLBuilder,TD extends UncheckedCrudDao<T,ID,SB,TD>>
      Parameters:
      ids -
      Returns:
      Throws:
      com.landawn.abacus.exception.UncheckedSQLException - the unchecked SQL exception
    • batchDeleteByIds

      int batchDeleteByIds(Collection<? extends ID> ids, int batchSize) throws com.landawn.abacus.exception.UncheckedSQLException
      Specified by:
      batchDeleteByIds in interface CrudDao<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.UncheckedSQLException - the unchecked SQL exception