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

com.sneakxy.mybatis.commons.repository.ExpandRepository Maven / Gradle / Ivy

The newest version!
package com.sneakxy.mybatis.commons.repository;

import java.io.Serializable;
import java.util.List;
import java.util.Optional;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.repository.NoRepositoryBean;
import org.springframework.data.repository.Repository;

import com.sneakxy.mybatis.commons.repository.query.domain.Criteria;

/**
 * @author 潜行的虚影
 */
@NoRepositoryBean
public interface ExpandRepository extends Repository {

	String getTableName();
	
	 S save(S entity, String table_name);
	
	 void update(S entity, String table_name, Criteria criteria);
	
	void deleteById(ID id, String table_name);
	
	void delete(Criteria criteria, String table_name);
	
	boolean existsById(ID id, String table_name);
	
	boolean exists(Criteria criteria, String table_name);
	
	Optional findById(ID id, String table_name);
	
	T findOne(Criteria criteria, String table_name);

	List findAll(Criteria criteria, String table_name);
	
	Page findAll(Criteria criteria, String table_name, Pageable pageable);
	
	List findAll(Criteria criteria, String table_name, Sort sort);
	
	long count(Criteria criteria, String table_name);
	
	long count(String table_name);
	
	Iterable findAll(String table_name);
	
	Iterable findAll(String table_name, Sort sort);
	
	Page findAll(String table_name, Pageable pageable);
	
	void deleteAll(String table_name);
	
	boolean isNew(T entity);
	
}