Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.himanshu-soni:QuantumFlux:'
}
dependencies {
implementation("com.github.himanshu-soni:QuantumFlux:")
}
<dependency>
<groupId>com.github.himanshu-soni</groupId>
<artifactId>QuantumFlux</artifactId>
<version></version>
</dependency>
libraryDependencies += "com.github.himanshu-soni" % "QuantumFlux" % ""
:dependencies [[com.github.himanshu-soni/QuantumFlux ""]]
A Powerful Android Content Provider ORM. It uses Content Providers to access the data and internally uses SQLite to actually store the data.
It can be used as a typical ORM, by creating Java objects and applying some Annotations and/or by extending QuantumFluxRecord
on them and
they will be accessed normally and creates ContentProvider.
For more information in detail, please check Wiki page.
QuantumFluxRecord
.QueryBuilder
, complex queries can be created very easily.add following line to your module's dependency list:
compile 'me.himanshusoni:quantum-flux:0.9.3'
Declare the dependency in Maven:
<dependency>
<groupId>me.himanshusoni</groupId>
<artifactId>quantum-flux</artifactId>
<version>0.9.3</version>
<type>pom</type>
</dependency>
You can also download the source and import as library project.
See releases page to download jar for latest version directly.
===================
Install the project via any of the method above. and extend Application
class and use it as following:
public class SampleApplication extends Application {
@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
QuantumFlux.initialize(this);
}
}
register this application class in Manifest file:
<application
android:name="me.himanshusoni.quantumflux.sample.SampleApplication"
...
>
add following meta data in <application>
tag
<meta-data android:name="AUTHORITY" android:value="me.himanshusoni.quantumflux.sample" />
<meta-data android:name="DATABASE_NAME" android:value="QuantumFluxSample.sqlite" />
<meta-data android:name="DATABASE_VERSION" android:value="1" />
<meta-data android:name="PACKAGE_NAME" android:value="me.himanshusoni.quantumflux.sample" />
<meta-data android:name="QUERY_LOG" android:value="true" /> <!-- Optional -->
register content provider:
<provider
android:name="me.himanshusoni.quantumflux.provider.QuantumFluxContentProvider"
android:authorities="me.himanshusoni.quantumflux.sample"
android:exported="false" />
Now, you just have to create modal classes by:
annotation:
@Table
public class Book {
...
}
extending class:
public class Author extends QuantumFluxRecord<Author> {
public String name;
...
}
Access:
Book book = new Book();
book.name = "Sorcerer's Stone";
book.isbn = "122342564";
QuantumFlux.insert(book);
Author author = new Author();
author.name = "J.K. Rollings";
author.save();
Author first = Select.from(Author.class).first();
first.name = "J. K. Rowling";
first.update();
QuantumFlux.deleteAll(Book.class);
Author first = Select.from(Author.class).first();
first.delete();
=========================
For detailed configuration and advance usages, go through https://github.com/himanshu-soni/QuantumFlux/wiki
Inspired from https://github.com/wackymax/CPOrm and https://github.com/satyan/sugar
Special thanks to Satya Narayan (@satyan) and Hennie Brink (@Wackymax).
developed to make programming easy.
by Himanshu Soni (himanshu_soni@mail.com)