Skip to content
This repository has been archived by the owner on Jul 12, 2021. It is now read-only.

pandyin/rxrealm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1 DOWNLOAD

2 USAGE

3 GENERATED CLASS

4 OPERATIONS

DOWNLOAD

project build.gradle:

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

module build.gradle:

dependencies {
  compile 'com.github.pandyin:rxrealm:1.2.1'
}

USAGE

example:

Car.java

@RxRealm
public class Car extends RealmObject {

    @PrimaryKey
    private String id;
    private String color;
    private int model;

AUTO GENERATED CLASS

...

example:

RxCar.java

OPERATIONS

get operation:

format:

fieldName + condition

example:

MainActivity.java

RxCar.get().idEqualTo(id) //condition
              .colorEqualTo(color)  //condition
              .modelGreaterThan(model) //condition
              .getAysnc(); //execute

condition operations:

equalTo Equal-to comparison.

notEqualTo Not-equal-to comparison.

in In comparison.

notIn Not-in comparison.

lessThan Less-than comparison.

greaterThan Greater-than comparison.

sortBy Sorted by specific field name.

or Logical-or two conditions.

first Finds the first object that fulfills the query conditions.

execute operations:

getAysnc Finds objects that fulfill the query conditions.

deleteAsync Deletes objects that fulfill the query conditions.

countAsync Counts objects that fulfill the query conditions.

other operation:

edit Updates objects that fulfill the query conditions with Set operation

set operation:

format:

"set" + fieldName

example:

MainActivity.java

RxCar.set(id)
        .setColor(pink)
        .setModel(2019)
        .setAsync(); //execute

execute operation:

setAsync Updates objects that fulfill the query conditions with provided data.