Coder Social home page Coder Social logo

ccrud's Introduction

ccrud

封装了sp,file,sql三种方式,主要是方便调用,目前不支持集合类的map

使用分三步:

第一步:

// 初始化数据,建议用applicationContext 1、CCRUD.init(context);

第二步:

// 建造SP存储框架

2、CCRUD.buildStorage().setStorageType(StorageType.SHAREPREFERENCE).setFileName("aaa").complete();

// 构造SQL 存储框架

3、CCRUD.buildStorage().setStorageType(StorageType.SQL).setFileName("aaa").setVersion(10).complete();

// 建造File 存储框架

4CCRUD.buildStorage().setFileName("aaa.txt").setVersion(11).setFilePath(this.getFilesDir().getAbsolutePath()).setStorageType(StorageType.MFILE).complete();

说明:

1、setStorageType();设置存储的类型,分三种:SP ,SQL , File

2、构造完一定要调用complete()方法来确认。

第三步(示例):

1、CCRUD.getStorage(StorageType.SQL).save("9660", list);

2、TextDemo textDemo = CCRUD.getStorage(StorageType.SHAREPREFERENCE).get("543", null, TextDemo.class);

说明:如下所示,更换一下存储方式,给到不同的存储器,并进行操作。

ccrud's People

Watchers

 avatar  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.