Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

deckyfx/dbhelper

Repository files navigation

dbhelper

Adapterview made easy

Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
	...
		maven { url 'https://jitpack.io' }
	}
}

Add the dependency

dependencies {
	compile 'org.greenrobot:greendao:3.2.0'
	compile 'com.github.deckyfx:dbhelper:-SNAPSHOT'
}

Usage

In your Activity / Application

...
DBHelper DB = new DBHelper(getApplicationContext(), DaoMaster.class, "app.db");
...
...
DBHelper.EntityMapWrapper entity    = DB.getEntity(/* Entity Name */);
Property keyProperty                = entity.getProperty("key");
Object settings                     = entity.queryBuilder().where(keyProperty.eq(key)).limit(1).list();
/* Or */
ArrayList<Object> list              = entity.loadAll();
...

More sample is [here]

Feature: