Skip to content

jiashilei-1985/EasyLite-Orm

 
 

Repository files navigation

EasyliteOrm Build Status Coverage Status

Very simple Object Relationship Mapping framework (ORM) for Android.

Features

  • Very minimal configuration.
  • Annotation driven data modeling
  • POJO Entity Classes that are loosely coupled
  • Use of Data Access Objects for CRUD operations

##Installation ####Gradle

compile 'com.easyliteorm:easyliteorm:1.0.1'

####Maven

<dependency>
  <groupId>com.easyliteorm</groupId>
  <artifactId>easyliteorm</artifactId>
  <version>1.0.1</version>
</dependency>

##Basic Setup #####Configuration Add information about datababse to AndroidManifest.xml

<application>
    <meta-data android:name="DATABASE" android:value="dbname.db" />
    <meta-data android:name="VERSION" android:value="1" />
    <meta-data android:name="MODEL_PACKAGE_NAME" android:value="com.somepackagename.model" />
</application>

Define Entity Model

@Entity
public class Note {
	@Id(strategy = GenerationType.AUTO)
	public int id;
	public String body;
	public String author;
}

#####Usage Get singleton instance of EasyLite to create Data Access Object (DAO)

Dao dao = EasyLite.getInstance(context)
                                 .getDao(Note.class);
Note note = new Note ();
dao.create(note);
List notes = dao.findAll();

###License The MIT License (MIT)

Copyright (c) 2015 Mario Dennis

http://www.opensource.org/licenses/mit-license.php

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Get Started with EasyliteOrm!

About

A simple android orm

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%