Skip to content

Repository files navigation

Android-SQLiteModel

Basic SQLite ORM library for Android

DownloadBuild Status

Install

Gradle

compile 'ie.mavon.sqlitemodel:sqlitemodel:1.0.0'

Maven

<dependency>
<groupId>ie.mavon.sqlitemodel</groupId>
<artifactId>sqlitemodel</artifactId>
<version>1.0.0</version>
<type>pom</type>
</dependency>

Basic Usage

SQLiteModel allows you to make saving/retrieving objects to sqlite very easy:

Employee Class:

publicclassEmployeeextendsSQLiteModel {
privatestaticMap<String, Integer> dbColumns = null;
privateStringname;
@OverridepublicMap<String, Integer> getDbColumns() {
if (dbColumns == null) {
dbColumns = newHashMap<>();
dbColumns.put("name", TYPE_TEXT);
SQLiteModel.setDBColumns(dbColumns);
}
returndbColumns;
}
@OverrideprotectedStringgetTableName() {
return"employees";
}
publicStringgetName() {
returnname;
}
publicvoidsetName(Stringname) {
this.name = name;
}
}
Employeeemployee = newEmployee();
employee.setName("Joe Blogs";
employee.save(); //Persisted to the db

About

SQLite model library for Android

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages