接口 SqlToyCRUDService

  • 所有已知实现类:
    SqlToyCRUDServiceImpl

    public interface SqlToyCRUDService
    版本:
    v1.0,Date:2012-7-16
    作者:
    zhongxuchen
    • 方法详细资料

      • saveAll

        <T extends SerializableLong saveAll​(List<T> entities)
        类型参数:
        T -
        参数:
        entities -
        返回:
      • saveAllIgnoreExist

        <T extends SerializableLong saveAllIgnoreExist​(List<T> entities)
        类型参数:
        T -
        参数:
        entities -
        返回:
      • update

        Long update​(Serializable entity,
                    String... forceUpdateProps)
        参数:
        entity -
        forceUpdateProps -
        返回:
      • updateCascade

        Long updateCascade​(Serializable entity,
                           String... forceUpdateProps)
        参数:
        entity -
        forceUpdateProps -
        返回:
      • updateDeeply

        Long updateDeeply​(Serializable entity)
        参数:
        entity -
        返回:
      • updateAll

        <T extends SerializableLong updateAll​(List<T> entities,
                                                String... forceUpdateProps)
        类型参数:
        T -
        参数:
        entities -
        forceUpdateProps - 强制修改的字段
        返回:
      • updateAllDeeply

        <T extends SerializableLong updateAllDeeply​(List<T> entities)
        类型参数:
        T -
        参数:
        entities -
        返回:
      • saveOrUpdate

        Long saveOrUpdate​(Serializable entity,
                          String... forceUpdateProps)
        参数:
        entity - 实体对象
        forceUpdateProps - 强制修改的对象属性
        返回:
      • saveOrUpdateAll

        <T extends SerializableLong saveOrUpdateAll​(List<T> entities,
                                                      String... forceUpdateProps)
        类型参数:
        T -
        参数:
        entities - 对象集合
        forceUpdateProps - 需强制修改的属性
        返回:
      • load

        <T extends Serializable> T load​(T entity)
        参数:
        entity -
        返回:
      • loadCascade

        <T extends Serializable> T loadCascade​(T entity)
        参数:
        entity -
        返回:
      • deleteAll

        <T extends SerializableLong deleteAll​(List<T> entities)
        类型参数:
        T -
        参数:
        entities -
        返回:
      • truncate

        void truncate​(Class entityClass)
        参数:
        entityClass -
      • isUnique

        boolean isUnique​(Serializable entity,
                         String... paramsNamed)
        参数:
        entity -
        paramsNamed - group+uniqueField 对象属性名称(不是数据库表字段名称)
        返回:
      • wrapTreeTableRoute

        boolean wrapTreeTableRoute​(Serializable entity,
                                   String pidField)
        参数:
        entity -
        pidField - 父节点属性名称(java对象属性名称)
        返回:
      • wrapTreeTableRoute

        boolean wrapTreeTableRoute​(Serializable entity,
                                   String pidField,
                                   int appendIdSize)
        参数:
        entity -
        pidField - 父节点属性名称(java对象属性名称)
        appendIdSize - 构造成nodeRoute时单个id值的长度,如:1001,1002如果长度设置为6,则001001,001002
        返回:
      • loadAll

        <T extends SerializableList<T> loadAll​(List<T> entities)
        参数:
        entities -
        返回:
      • loadAllCascade

        <T extends SerializableList<T> loadAllCascade​(List<T> entities,
                                                        Class... cascadeTypes)
        参数:
        entities -
        cascadeTypes - 级联加载的子表对象类型
        返回:
      • loadByIds

        <T extends SerializableList<T> loadByIds​(Class<T> voClass,
                                                   Object... ids)
        类型参数:
        T -
        参数:
        voClass -
        ids -
        返回:
      • generateBizId

        long generateBizId​(String signature,
                           int increment)
        参数:
        signature - 格式:tableName_yyyyMMdd,如:staff_info20210701
        increment -
        返回:
      • translate

        void translate​(Collection dataSet,
                       String cacheName,
                       TranslateHandler translateHandler)
        参数:
        dataSet -
        cacheName -
        translateHandler - 反调方法:取key 和回写名称
      • translate

        void translate​(Collection dataSet,
                       String cacheName,
                       String cacheType,
                       Integer cacheNameIndex,
                       TranslateHandler translateHandler)
        参数:
        dataSet -
        cacheName -
        cacheType - 针对类似数据字典性质的有分类的缓存
        cacheNameIndex - 手动指定缓存中名称对应的列(缓存默认格式为:key,name,extName1,extName2 默认cacheNameIndex为1)
        translateHandler -
      • existCache

        boolean existCache​(String cacheName)
        参数:
        cacheName -
        返回:
      • getCacheNames

        Set<String> getCacheNames()
        返回:
      • cacheMatchKeys

        String[] cacheMatchKeys​(CacheMatchFilter cacheMatchFilter,
                                String... matchRegexes)
        参数:
        cacheMatchFilter -
        matchRegexes - 匹配表达式,如:中国 上海,xxx公司
        返回:
      • convertType

        <T extends Serializable> T convertType​(Serializable source,
                                               Class<T> resultType)
        类型参数:
        T -
        参数:
        source -
        resultType -
        返回:
      • convertType

        <T extends SerializableList<T> convertType​(List sourceList,
                                                     Class<T> resultType)
        类型参数:
        T -
        参数:
        sourceList -
        resultType -
        返回:
      • convertType

        <T extends SerializablePage<T> convertType​(Page sourcePage,
                                                     Class<T> resultType)
        类型参数:
        T -
        参数:
        sourcePage -
        resultType -
        返回:
      • parallQuery

        <T> List<QueryResult<T>> parallQuery​(List<ParallQuery> parallQueryList,
                                             String[] paramNames,
                                             Object[] paramValues,
                                             ParallelConfig parallelConfig)
        参数:
        parallQueryList -
        paramNames -
        paramValues -
        parallelConfig - 例如:ParallelConfig.create().maxThreads(20)
        返回: