Git Product home page Git Product logo

androiddb's Introduction

Fire

为Android打造的数据库。代码精简小巧,性能卓越,去掉很多没有用的数据库操作,例如外联,内连等,只保留移动端会用到的数据库操作。 代码小巧,简单易懂。

特点

1.一行代码实现增删改查 2.代码少,简单易懂

Usage

在Application当中

   @Override
       public void onCreate() {

           super.onCreate();

           DBBase.Config config = DBBase.builcConfig()
                   .setName("dbName.db")
                   .setVersion(1)
                   .setCallback(new DBCallback() {
                       @Override
                       public void dbCreate() {

                       }

                       @Override
                       public void dbUpdate(SQLiteDatabase db, int oldVersion, int newVersion) {

                       }
                   });

           DBBase.getBase().init(this,config).creatTables(new Class[]{Person.class});
   }
    DBBase.newDBHelper().save(person); //插入一条数据
    DBBase.newDBHelper().save(persons); //插入多条数据

    List<Person> result = DBBase.newDBHelper().find(Person.class); //查找所有
    DBBase.newDBHelper().from(Person.class).where("name","=","jack").and("age",">","12").find(); //条件查找

    DBBase.newDBHelper().update(person); //修改 注意id不能null
    DBBase.newDBHelper().update(persons);//修改多条

    ///delete
    DBBase.newDBHelper().deleteById(Person.class , "1"); ///根据ID删除
    DBBase.newDBHelper().deleteById(objects); ///根据ID删除一组
    DBBase.newDBHelper().delete(Person.class, WhereInfo.Builder.buildWhere("name", "=", "jack").and("age", ">", "12").build());

androiddb's People

Contributors

cyuanyang avatar

Stargazers

 avatar  avatar  avatar

Watchers

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