All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.xream.x7.repository.BaseRepository Maven / Gradle / Ivy

There is a newer version: 2.3.13.RELEASE
Show newest version
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.xream.x7.repository;

import io.xream.x7.common.bean.Criteria;
import io.xream.x7.common.bean.RowHandler;
import io.xream.x7.common.bean.condition.InCondition;
import io.xream.x7.common.bean.condition.RefreshCondition;
import io.xream.x7.common.bean.condition.RemoveRefreshCreate;
import io.xream.x7.common.web.Page;

import java.util.List;
import java.util.Map;

/**
 * jdbc-template-plus programmer API
 *
 * @param 
 * @author Sim
 */
public interface BaseRepository extends Typed {

    long createId();

    void refreshCache();

    boolean createBatch(List objList);

    long create(T obj);

    /**
     * replace: clear all the value of the row, and insert the new value 
     * is not refreshOrCreate 
     * x7 will not support refreshOrCreate, coding: query at first, then refresh of create 
*/ boolean createOrReplace(T obj); boolean refresh(RefreshCondition RefreshCondition_build); /** * * refreshCondition without keyOne */ boolean refreshUnSafe(RefreshCondition RefreshCondition_build); boolean remove(String keyOne); boolean remove(long keyOne); /** * * caution: sometimes, should not use the api * */ boolean removeRefreshCreate(RemoveRefreshCreate RemoveRrefreshCreate_wrap); /** * @param keyOne */ T get(long keyOne); T get(String keyOne); /** * LOAD * */ List list(); /** * 根据对象查询 * * @param conditionObj */ List list(T conditionObj); T getOne(T conditionObj); /** * in API * */ List in(InCondition InCondition_wrap); /** * Standard query pageable API * * @param CriteriaBuilder_build_get */ Page find(Criteria CriteriaBuilder_build_get); Page> find(Criteria.ResultMappedCriteria CriteriaBuilder_ResultMappedBuilder_build_get); List> list(Criteria.ResultMappedCriteria CriteriaBuilder_ResultMappedBuilder_build_get); List listPlainValue(Class clzz, Criteria.ResultMappedCriteria CriteriaBuilder_ResultMappedBuilder_build_get); List list(Criteria CriteriaBuilder_build_get); /** * like stream, fetchSize=50, the api not fast, to avoid OOM when scheduling * @param criteria * @param handler * @param */ void findToHandle(Criteria criteria, RowHandler handler); /** * like stream, fetchSize=50, the api not fast, to avoid OOM when scheduling * @param resultMappedCriteria * @param handler */ void findToHandle(Criteria.ResultMappedCriteria resultMappedCriteria, RowHandler> handler); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy