Interface JKDataAccessService

All Known Implementing Classes:
H2DataAccess, JKDataAccessImpl, JKOracleDataAccess, MysqlDataAccess

public interface JKDataAccessService
The Interface JKDataAccessService.
  • Method Details

    • executeQueryAsCachedRowSet

      CachedRowSet executeQueryAsCachedRowSet(String query, Object... params)
      Execute query as cached row set.
      Parameters:
      query - the query
      params - the params
      Returns:
      the cached row set
    • executeQueryAsIdValue

      List<JKDbIdValue> executeQueryAsIdValue(String sql, Object... params)
      Execute query as id value.
      Parameters:
      sql - the sql
      params - the params
      Returns:
      the list
    • executeUpdate

      Object executeUpdate(JKUpdater updater)
      Execute update.
      Parameters:
      updater - the updater
      Returns:
      the int
    • execute

      int execute(String sql, Object... params)
      Execute.
      Parameters:
      sql - the sql
      params - the params
      Returns:
      the int
    • executeSingleOutputQuery

      Object executeSingleOutputQuery(String query, Object... params)
      Exeute single output query.
      Parameters:
      query - the query
      params - the params
      Returns:
      the object
    • getNextId

      Long getNextId(String tableName, String fieldName)
      Gets the next id.
      Parameters:
      tableName - the table name
      fieldName - the field name
      Returns:
      the next id
    • getNextId

      Long getNextId(String tableName, String fieldName, String condition)
      Gets the next id.
      Parameters:
      tableName - the table name
      fieldName - the field name
      condition - the condition
      Returns:
      the next id
    • getRowsCount

      int getRowsCount(String query, Object... params)
      Gets the rows count.
      Parameters:
      query - the query
      params - the params
      Returns:
      the rows count
    • executeQueryAsString

      String executeQueryAsString(String query, Object... params)
      Execute query as string.
      Parameters:
      query - the query
      params - the params
      Returns:
      the string
    • executeQueryAsString

      String executeQueryAsString(String query, String fieldSeparator, String recordsSepartor, Object... params)
      Execute query as string.
      Parameters:
      query - the query
      fieldSeparator - the field separator
      recordsSepartor - the records separtor
      params - the params
      Returns:
      the string
    • executeUpdate

      Object executeUpdate(JKUpdater updater, boolean ignoreRecordNotFoundException)
      Execute update.
      Parameters:
      updater - the updater
      ignoreRecordNotFoundException - the ignore record not found exception
      Returns:
      the int
    • executeQueryAsList

      List<List<Object>> executeQueryAsList(String query, Object... params)
      Execute query as list.
      Parameters:
      query - the query
      params - the params
      Returns:
      the list
    • findRecord

      <T> T findRecord(JKFinder finder, String tableName, Object recordId)
      Find record.
      Type Parameters:
      T - the generic type
      Parameters:
      finder - the finder
      tableName - the table name
      recordId - the record id
      Returns:
      the t
    • findRecord

      <T> T findRecord(JKFinder finder)
      Find record.
      Type Parameters:
      T - the generic type
      Parameters:
      finder - the finder
      Returns:
      the t
    • getSystemDate

      Date getSystemDate()
      Gets the system date.
      Returns:
      the system date
    • getList

      <T> List<T> getList(JKFinder finder)
      Gets the list.
      Type Parameters:
      T - the generic type
      Parameters:
      finder - the finder
      Returns:
      the list
    • getList

      <T> List<T> getList(JKFinder finder, String key)
      Gets the list.
      Type Parameters:
      T - the generic type
      Parameters:
      finder - the finder
      key - the key
      Returns:
      the list
    • executeQueryAsArray

      Object[] executeQueryAsArray(String query, Object... params)
      Execute query as array.
      Parameters:
      query - the query
      params - the params
      Returns:
      the object[]
    • isTableExists

      boolean isTableExists(String tableName)
      Checks if is table exists.
      Parameters:
      tableName - the table typeName
      Returns:
      true, if is table exists
    • runScript

      void runScript(String fileName)
      Run script.
      Parameters:
      fileName - the file name
    • dropTable

      void dropTable(String string)
      Drop table.
      Parameters:
      string - the string
    • executeUpdate

      Object executeUpdate(String sql, Object... objects)
      Execute update.
      Parameters:
      sql - the sql
      objects - the objects
      Returns:
      the object
    • executeQueryAsLong

      default long executeQueryAsLong(String query, Object... params)
      Execute query as integer.
      Parameters:
      query - the query
      params - the params
      Returns:
      the int
    • executeQueryAsDouble

      default double executeQueryAsDouble(String query, Object... params)
      Execute query as double.
      Parameters:
      query - the query
      params - the params
      Returns:
      the double
    • executeQueryAsRow

      default Object[] executeQueryAsRow(String query, Object... params)
      Execute query as row.
      Parameters:
      query - the query
      params - the params
      Returns:
      the object[]
    • executeQueryAsListOfObjects

      default <T> List<T> executeQueryAsListOfObjects(Class<T> clas, String query, Object... params)
      Execute query as list of objects.
      Type Parameters:
      T - the generic type
      Parameters:
      clas - the clas
      query - the query
      params - the params
      Returns:
      the list
    • executeQueryAsListOfObjects

      default <T> List<T> executeQueryAsListOfObjects(Class<T> clas, Map<String,Object> fieldsMapping, String query, Object... params)
      Execute query as list of objects.
      Type Parameters:
      T - the generic type
      Parameters:
      clas - the clas
      fieldsMapping - the fields mapping
      query - the query
      params - the params
      Returns:
      the list
    • executeQueryAsInteger

      default int executeQueryAsInteger(String query, Object... params)
      Execute query as integer.
      Parameters:
      query - the query
      params - the params
      Returns:
      the int
    • find

      <T> T find(String query, JKPopulator<T> populator, Object... params)
      Find.
      Type Parameters:
      T - the generic type
      Parameters:
      query - the query
      populator - the populator
      params - the params
      Returns:
      the t
    • findAndCacheRecord

      <T> T findAndCacheRecord(String tableName, String query, JKPopulator<T> populator, Object... params)
      Find and cache record.
      Type Parameters:
      T - the generic type
      Parameters:
      tableName - the table name
      query - the query
      populator - the populator
      params - the params
      Returns:
      the t
    • getList

      <T> List<T> getList(String query, JKPopulator<T> populator, Object... params)
      Gets the list.
      Type Parameters:
      T - the generic type
      Parameters:
      query - the query
      populator - the populator
      params - the params
      Returns:
      the list
    • getListAndCache

      <T> List<T> getListAndCache(String tableName, String query, JKPopulator<T> populator, Object... params)
      Gets the list and cache.
      Type Parameters:
      T - the generic type
      Parameters:
      tableName - the table name
      query - the query
      populator - the populator
      params - the params
      Returns:
      the list and cache
    • describeTable

      Map<String,String> describeTable(String name)
      Describe table.
      Parameters:
      name - the name
      Returns:
      the map
    • beginTransaction

      void beginTransaction()
      Begin transaction.
    • closeTransaction

      void closeTransaction(boolean commit)
      Close transaction.
      Parameters:
      commit - the commit
    • executeQueryAsMap

      default <T> Map<Object,T> executeQueryAsMap(String sql, Object... params)
      Execute query as map.
      Type Parameters:
      T - the generic type
      Parameters:
      sql - the sql
      params - the params
      Returns:
      the map