Giter Club home page Giter Club logo

jcache's Introduction

jcache

功能

针对数据访问层进行缓存,以减少数据库操作。提供了当今流程的注解方式进行简单的缓存配置。

特色

  • 缓存广(增、删、改操作都直接操作内存对象,无需重新数据库获取对象)
  • 用户使用方便(通过注解则可使用缓存)
  • 灵活性高,框架同时提供了API可由用户手动缓存
  • 查询高效,框架保存了条件对象链

Demo

注解方式

public interface UserDao {
	@Cache(operateType=OperateType.INSERT)
	int insert(@CacheBean User user);
	
	@Cache(operateType=OperateType.UPDATE)
	int update(@CacheBean User user);
	
	@Cache(operateType=OperateType.DELETE)
	int delete(@CacheBean int userId);
	
	@Cache(operateType=OperateType.SELECT,value= {"password"})
	List<User> selectUserByPassword(String password);
	
	@Cache(value = {"user.password"},operateType=OperateType.SELECT)
	List<User> selectUserByUser(@CacheBean(value="user") User user);
	
	@Cache(operateType=OperateType.SELECT)
	List<User> selectAllUser();
}

API接口

例:缓存对象

CacheSingleton<User> cacheSingleton = CacheSingleton.getInstance();
		BeanContainer<User> beanContainer = cacheSingleton.getBeanContainer(User.class);
		User user = new User();
		Bean<User> bean = new Bean<>();
		bean.setBean(user);
		beanContainer.setBean(bean, user.getUserid());

jcache's People

Contributors

jokerblazes avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.