Class JDBCRepository<Entity>

java.lang.Object
cool.scx.data.jdbc.JDBCRepository<Entity>
All Implemented Interfaces:
cool.scx.data.AggregatableRepository<Entity,Long>, cool.scx.data.LockableRepository<Entity,Long>, cool.scx.data.Repository<Entity,Long>

public class JDBCRepository<Entity> extends Object implements cool.scx.data.AggregatableRepository<Entity,Long>, cool.scx.data.LockableRepository<Entity,Long>
使用 JDBC 接口, 通过 SQL 操作关系型数据库的 DAO
Version:
0.0.1
Author:
scx567888
  • Constructor Details

  • Method Details

    • add

      public final Long add(Entity entity, cool.scx.data.field_policy.FieldPolicy fieldPolicy) throws cool.scx.data.exception.DataAccessException
      Specified by:
      add in interface cool.scx.data.Repository<Entity,Long>
      Throws:
      cool.scx.data.exception.DataAccessException
    • add

      public final List<Long> add(Collection<Entity> entityList, cool.scx.data.field_policy.FieldPolicy fieldPolicy) throws cool.scx.data.exception.DataAccessException
      Specified by:
      add in interface cool.scx.data.Repository<Entity,Long>
      Throws:
      cool.scx.data.exception.DataAccessException
    • finder

      public final cool.scx.data.Finder<Entity> finder(cool.scx.data.query.Query query, cool.scx.data.field_policy.FieldPolicy fieldPolicy, cool.scx.data.LockMode lockMode)
      Specified by:
      finder in interface cool.scx.data.LockableRepository<Entity,Long>
    • finder

      public final cool.scx.data.Finder<Entity> finder(cool.scx.data.query.Query query, cool.scx.data.field_policy.FieldPolicy fieldPolicy)
      Specified by:
      finder in interface cool.scx.data.Repository<Entity,Long>
    • update

      public final long update(Entity entity, cool.scx.data.field_policy.FieldPolicy fieldPolicy, cool.scx.data.query.Query query) throws cool.scx.data.exception.DataAccessException
      Specified by:
      update in interface cool.scx.data.Repository<Entity,Long>
      Throws:
      cool.scx.data.exception.DataAccessException
    • delete

      public final long delete(cool.scx.data.query.Query query) throws cool.scx.data.exception.DataAccessException
      Specified by:
      delete in interface cool.scx.data.Repository<Entity,Long>
      Throws:
      cool.scx.data.exception.DataAccessException
    • clear

      public final void clear() throws cool.scx.data.exception.DataAccessException
      Specified by:
      clear in interface cool.scx.data.Repository<Entity,Long>
      Throws:
      cool.scx.data.exception.DataAccessException
    • aggregator

      public final cool.scx.data.Aggregator aggregator(cool.scx.data.query.Query beforeAggregateQuery, cool.scx.data.aggregation.Aggregation aggregation, cool.scx.data.query.Query afterAggregateQuery)
      Specified by:
      aggregator in interface cool.scx.data.AggregatableRepository<Entity,Long>
    • entityClass

      public final Class<Entity> entityClass()
    • table

      public final EntityTable<Entity> table()
    • sqlRunner

      public final SQLRunner sqlRunner()
    • beanBuilder

      public BeanBuilder<Entity> beanBuilder()
    • entityBeanListHandler

      public ResultHandler<List<Entity>, RuntimeException> entityBeanListHandler()
    • entityBeanHandler

      public ResultHandler<Entity, RuntimeException> entityBeanHandler()
    • jdbcContext

      public JDBCContext jdbcContext()
    • buildInsertSQL

      public SQL buildInsertSQL(Entity entity, cool.scx.data.field_policy.FieldPolicy fieldPolicy)
    • buildInsertBatchSQL

      public SQL buildInsertBatchSQL(Collection<? extends Entity> entityList, cool.scx.data.field_policy.FieldPolicy fieldPolicy)
    • buildSelectSQL

      public SQL buildSelectSQL(cool.scx.data.query.Query query, cool.scx.data.field_policy.FieldPolicy fieldPolicy)
    • buildSelectFirstSQL

      public SQL buildSelectFirstSQL(cool.scx.data.query.Query query, cool.scx.data.field_policy.FieldPolicy fieldPolicy)
    • buildUpdateSQL

      public SQL buildUpdateSQL(Entity entity, cool.scx.data.field_policy.FieldPolicy fieldPolicy, cool.scx.data.query.Query query)
    • buildDeleteSQL

      public SQL buildDeleteSQL(cool.scx.data.query.Query query)
    • buildCountSQL

      public SQL buildCountSQL(cool.scx.data.query.Query query)
    • buildSelectFirstSQLWithAlias

      public SQL buildSelectFirstSQLWithAlias(cool.scx.data.query.Query query, cool.scx.data.field_policy.FieldPolicy fieldPolicy)
    • buildSelectSQLWithAlias

      public SQL buildSelectSQLWithAlias(cool.scx.data.query.Query query, cool.scx.data.field_policy.FieldPolicy fieldPolicy)
    • buildAggregateSQL

      public SQL buildAggregateSQL(cool.scx.data.query.Query beforeAggregateQuery, cool.scx.data.aggregation.Aggregation aggregation, cool.scx.data.query.Query afterAggregateQuery)
    • buildAggregateFirstSQL

      public SQL buildAggregateFirstSQL(cool.scx.data.query.Query beforeAggregateQuery, cool.scx.data.aggregation.Aggregation aggregation, cool.scx.data.query.Query afterAggregateQuery)
    • buildSelectSQL

      public SQL buildSelectSQL(cool.scx.data.query.Query query, cool.scx.data.field_policy.FieldPolicy fieldPolicy, cool.scx.data.LockMode lockMode)
    • buildSelectFirstSQL

      public SQL buildSelectFirstSQL(cool.scx.data.query.Query query, cool.scx.data.field_policy.FieldPolicy fieldPolicy, cool.scx.data.LockMode lockMode)