Object-relational mapping for Android

Related tags

O/R Mapping RushOrm
Overview

Build Status Coverage Status Android Weekly Android Arsenal Join the chat at https://gitter.im/Stuart-campbell/RushOrm

RushOrm

Object-relational mapping for Android

RushOrm replaces the need for SQL by mapping java classes to SQL tables.


What is the aim?

The aim is to abstract away all SQLite interaction under a very simple interface to make object storage incredibly quick to implement.


What projects is it right for?

  • Projects with complex data structures
  • Projects that want to implement database storage in the minimum amount of time
  • Projects that talk to a rest api

Why was RushOrm written?

  • Complex relationships - RushObjects support Lists of other RushObjects
  • SQL free migration
  • Easily extendable
  • No dependencies
  • Support asynchronous call
  • Be fast through compound inserts and selects
  • Support importing and exporting data to and from JSON
  • Unique ids to support merging databases
  • Supports conflict resolution when importing data
While there are a number of other ORMs, the areas many seem to fall short is the support of 'one to many' relationships, migration and extensions. While claiming all the same basic feature of most other ORMs RushOrm supports 'List' properties without having to add the parent object to it's children. It also handles migrating the class structure without any SQL scripts being required by the developer. Finally it is designed with the understanding that not every situation can be anticipated so instead it can be easily customized.

For getting started see http://www.rushorm.co.uk/


Rush jar can be downloaded from http://www.rushorm.co.uk/download.html alternatively it can be added as below.

Make sure your project is using maven central by including this in your gradle file:

repositories {
   mavenCentral()
}

Add the dependency in your build file:

dependencies {
   compile 'co.uk.rushorm:rushandroid:1.3.0’
}

Licence Apache License, Version 2.0

Copyright (C) 2015 Stuart Campbell Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Comments
  • Same RushSearch in different activities => not the same results

    Same RushSearch in different activities => not the same results

    Hi, I'm trying to make :

    List<Maquette> temp = new RushSearch().find(Maquette.class);
    System.out.println(temp.size());
    

    from two different activities but they don't display the same thing:

    • the MainActivity from which I create and save my two Maquette objects displays 2 (ok)
    • the MaquetteActivity from which I would like to get all my Maquettes to display them in a ListView displays 0

    I don't understand why... Could you help me ?

    opened by PaulineBAUDOUIN 27
  • Duplicated child RushObjects with circular relationships

    Duplicated child RushObjects with circular relationships

    Hi, it's me again, I have a problem which I can't manage to solve... I have a first ActivityA which starts ActivityB when onClick on a button. In my ActivityB, I want to create a new Projet (RushObject) so here is what I do to create it:

    Projet toCreateProj = new Projet();
                toCreateProj.identifier = 1;
                toCreateProj.title = editText.getText().toString();
                toCreateProj.maquette = selectedMaq; 
                toCreateProj.user = utilisateur;
                toCreateProj.save();
                utilisateur.projets.add(toCreateProj); // a Utilisateur (RushObject) has many Projets
                utilisateur.save();
                System.out.println(toCreateProj.maquette.gabarits.size()); // returns 3
                dialog.cancel();
                finish();
    

    selectedMaquette is a Maquette (RushObject) which I have by making a RushSearch. Same for utilisateur. My System.out returns 3 which is normal. On finish(), I go back to my ActivityA. In the onResume() i do:

    Projet toBeTested = new RushSearch().whereEqual("identifier", 1).findSingle(Projet.class); // I am sure it is the good project
            if(toBeTested != null){
                System.out.println("BIDON " + toBeTested.maquette.gabarits.size()); // returns 6
            }
    

    But now, my System.out returns 6 but should still return 3. I really don't get why... Any idea ? Thanks

    bug 
    opened by PaulineBAUDOUIN 21
  • Got the below error ,

    Got the below error ,

    android.database.sqlite.SQLiteConstraintException: UNIQUE constraint failed: rush_com_cc_dailyrounds_response_CaseListResponse_rush_com_cc_dailyrounds_response_User_details_user_details.rush_id (code 1555) at android.database.sqlite.SQLiteConnection.nativeExecuteForChangedRowCount(Native Method) at android.database.sqlite.SQLiteConnection.executeForChangedRowCount(SQLiteConnection.java:734) at android.database.sqlite.SQLiteSession.executeForChangedRowCount(SQLiteSession.java:754) at android.database.sqlite.SQLiteStatement.executeUpdateDelete(SQLiteStatement.java:64) at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1676) at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1605) at co.uk.rushorm.android.AndroidRushStatementRunner.runRaw(AndroidRushStatementRunner.java:37) at co.uk.rushorm.core.RushCore$9.runRaw(RushCore.java:368) at co.uk.rushorm.core.implementation.ReflectionUpgradeManager.moveRows(ReflectionUpgradeManager.java:284) at co.uk.rushorm.core.implementation.ReflectionUpgradeManager.upgrade(ReflectionUpgradeManager.java:122) at co.uk.rushorm.core.RushCore.upgrade(RushCore.java:358) at co.uk.rushorm.core.RushCore.access$300(RushCore.java:38) at co.uk.rushorm.core.RushCore$1.run(RushCore.java:100) at java.lang.Thread.run(Thread.java:818)

    opened by nagendraksrivastava 15
  • No DB update on second run

    No DB update on second run

    // I have a service with a List<>

    @RushList(classname = "com.app.gerpue.sturmgraznews.rss.RssItem")
    List<RssItem> rssItems = null;
    

    // add different Items to List

    rssItems.add ...........

    // save to DB .... but on second run ... nothing happens

    RushCore.getInstance().save(rssItems);

    // get Items from db and the new one lack

    List objects = new RushSearch().find(RssItem.class);

    // RssItem.class

    public class RssItem extends RushObject {

    private String title;
    private String link;
    private String pubDate;
    private String autor;
    private String autorimage;
    private String imageUrl;
    
    public RssItem(String title, String link, String pubDate, String autor, String autorimage, String imageUrl) {
        this.title = title;
        this.link = link;
        this.pubDate = pubDate;
        this.autor = autor;
        this.autorimage = autorimage;
        this.imageUrl = imageUrl;
    }
    
    public String getTitle() {        return title   }
    public String getLink() {        return link;    }
    public String getPublicationDate() {        return pubDate;    }
    public String getAutor() {        return autor;    }
    public String getAutorimage() {        return autorimage;    }
    public String getImageUrl() {        return imageUrl;    }
    
    public RssItem() {    }
    

    }

    // Manifest

        <meta-data android:name="news_db_version" android:value="1" />
    
        <!-- Database name -->
        <meta-data android:name="news_db_name" android:value="news.db" />
    
        <!-- Setting this to true will cause a migration to happen every launch,
        this is very handy during development although could cause data loss -->
        <meta-data android:name="Rush_debug" android:value="false" />
    
        <!-- Setting this to true mean that tables will only be created of classes that
        extend RushObject and are annotated with @RushTableAnnotation -->
        <meta-data android:name="Rush_requires_table_annotation" android:value="false" />
    
    opened by GerhardPue 14
  • Performance on startup

    Performance on startup

    Hi Stuart,

    I've one more question. Starting my application takes very long. The bottleneck is the Rush initialize. It takes around 4 seconds

        <meta-data
            android:name="Rush_db_version"
            android:value="3" />
        <meta-data
            android:name="Rush_db_name"
            android:value="appdatabase.db" />
        <meta-data
            android:name="Rush_debug"
            android:value="false" />
        <meta-data
            android:name="Rush_requires_table_annotation"
            android:value="false" />
    

    I've already deactivated the debug option - but still it takes around 3 to 4 seconds. Is there anything I can speed up when initializing?

    opened by fabsimilian 13
  • How to set ID?

    How to set ID?

    I can see a getID method, but I want to set ID prior to saving, its important because the local DB must have the same ID's as the server, so, server generates them, not the local DB.

    enhancement 
    opened by HDANILO 12
  • RushORM doesn't have an update function

    RushORM doesn't have an update function

    I tried to update using:

    new RushSearch().find(Story.class).get(0).setTitle("dfsdfs").build().save();

    then the result of that just creates another data in the database

    opened by pariola 11
  • Column not found error.

    Column not found error.

    As I posted on StackOverflow

    http://stackoverflow.com/questions/38311995/app-crashing-once-in-the-google-play-store-but-never-on-android-studio?noredirect=1#comment64041306_38311995

    The DB is crashing my app because it says type_of_check doesn't exist. As you can see on my post there, the field does exist.

    I also get this:

    android.database.sqlite.SQLiteException: no such column: type_of_check (code 1): , while compiling: SELECT * from rush_com_avena_avenafit_a_b WHERE type_of_check='1' AND check_date='2016-07-11' ;

    I already tried changing my db version:

    <!-- Updating this will cause a database upgrade --> <meta-data android:name="Rush_db_version" android:value="2" />

    Setting debug mode:

    <!-- Setting this to true will cause a migration to happen every launch, this is very handy during development although could cause data loss --> <meta-data android:name="Rush_debug" android:value="true" />

    And adding this suggestion which I have no idea what it does:

    ```

    Could anyone help me fixing this?

    opened by herrmartell 11
  • SQL Error when updating objects

    SQL Error when updating objects

    First, thanks for your great work. I'm planning to use your framework for my next app. I'm having the following issue: When I create objects with parent-child relationship, store them, load them again, change something and store them again the framework crashes with a SQL Error. See the following minimal working example:

    public class Child extends RushObject {
    
        private String string;
    
        public Child(String string) {
            this.string = string;
        }
    
        public Child() {
        }
    
        public String getString() {
            return string;
        }
    
        public void setString(String string) {
            this.string = string;
        }
    }
    
    public class Parent extends RushObject {
    
        @RushList(classname = "de.test.testrushorm.Child")
        private List<Child> children;
    
        public Parent() {
            this.children = new ArrayList<Child>();
        }
    
        public boolean add(Child child) {
            return children.add(child);
        }
    
        public boolean remove(Child child) {
            return children.remove(child);
        }
    
        public List<Child> getChildren() {
            return children;
        }
    }
    
    public class MainActivity extends ActionBarActivity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    
            Parent parent = new Parent();
            parent.save();
    
            Child firstChild = new Child();
            firstChild.save();
    
            Child secondChild = new Child();
            secondChild.save();
    
            parent.add(firstChild);
            parent.add(secondChild);
            parent.save();
    
            parent = new RushSearch().find(Parent.class).get(0);
            parent.getChildren().get(0).setString("test1");
            parent.save();
    
        }
    }
    

    Stacktrace:

    java.lang.RuntimeException: Unable to start activity ComponentInfo{de.test.testrushorm/de.test.testrushorm.MainActivity}: co.uk.rushorm.core.exceptions.RushSqlException: This is most likely caused by a change in data structure or new RushObject. This issue should be resolved by a database migration. This can be done by updating db version number in the manifest or setting Rush in debug mode. To set Rush in debug mode add this to your manifest file - at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2078) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2103) at android.app.ActivityThread.access$600(ActivityThread.java:137) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1211) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:137) at android.app.ActivityThread.main(ActivityThread.java:4827) at java.lang.reflect.Method.invokeNative(Native Method) at java.lang.reflect.Method.invoke(Method.java:511) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608) at dalvik.system.NativeStart.main(Native Method) Caused by: co.uk.rushorm.core.exceptions.RushSqlException: This is most likely caused by a change in data structure or new RushObject. This issue should be resolved by a database migration. This can be done by updating db version number in the manifest or setting Rush in debug mode. To set Rush in debug mode add this to your manifest file - at co.uk.rushorm.android.AndroidRushStatementRunner.runRaw(AndroidRushStatementRunner.java:35) at co.uk.rushorm.core.RushCore$6.createdOrUpdateStatement(RushCore.java:238) at co.uk.rushorm.core.implementation.ReflectionStatementGenerator$3.doAction(ReflectionStatementGenerator.java:366) at co.uk.rushorm.core.implementation.ReflectionStatementGenerator.doLoop(ReflectionStatementGenerator.java:73) at co.uk.rushorm.core.implementation.ReflectionStatementGenerator.updateObjects(ReflectionStatementGenerator.java:342) at co.uk.rushorm.core.implementation.ReflectionStatementGenerator.generateSaveOrUpdate(ReflectionStatementGenerator.java:169) at co.uk.rushorm.core.RushCore.save(RushCore.java:224) at co.uk.rushorm.core.RushCore.save(RushCore.java:95) at co.uk.rushorm.core.RushCore.save(RushCore.java:90) at co.uk.rushorm.core.RushObject.save(RushObject.java:10) at de.test.testrushorm.MainActivity.onCreate(MainActivity.java:30) at android.app.Activity.performCreate(Activity.java:5013) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1079) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2042) ... 11 more

    The error seems to be related to the creation of the sql update statements. Any ideas? Did I do something wrong?

    bug 
    opened by nis73 11
  • Loading saved data fails with java.lang.NumberFormatException: Invalid long:

    Loading saved data fails with java.lang.NumberFormatException: Invalid long: "true"

    Hi, I implemented it on 4 objects, and the saving works fine, but then loading the saved data gives the following exception:

    02-18 09:37:35.929: E/AndroidRuntime(18171): java.lang.NumberFormatException: Invalid long: "true" 02-18 09:37:35.929: E/AndroidRuntime(18171): at java.lang.Long.invalidLong(Long.java:124) 02-18 09:37:35.929: E/AndroidRuntime(18171): at java.lang.Long.parse(Long.java:361) 02-18 09:37:35.929: E/AndroidRuntime(18171): at java.lang.Long.parseLong(Long.java:352) 02-18 09:37:35.929: E/AndroidRuntime(18171): at java.lang.Long.parseLong(Long.java:318) 02-18 09:37:35.929: E/AndroidRuntime(18171): at co.uk.rushorm.core.implementation.RushColumnLong.deserialize(RushColumnLong.java:22) 02-18 09:37:35.929: E/AndroidRuntime(18171): at co.uk.rushorm.core.implementation.RushColumnLong.deserialize(RushColumnLong.java:9) 02-18 09:37:35.929: E/AndroidRuntime(18171): at co.uk.rushorm.core.implementation.RushColumnsImplementation.setField(RushColumnsImplementation.java:50) 02-18 09:37:35.929: E/AndroidRuntime(18171): at co.uk.rushorm.core.implementation.ReflectionClassLoader.loadClass(ReflectionClassLoader.java:108) 02-18 09:37:35.929: E/AndroidRuntime(18171): at co.uk.rushorm.core.implementation.ReflectionClassLoader.loadClasses(ReflectionClassLoader.java:59) 02-18 09:37:35.929: E/AndroidRuntime(18171): at co.uk.rushorm.core.implementation.ReflectionClassLoader$1.doAction(ReflectionClassLoader.java:176) 02-18 09:37:35.929: E/AndroidRuntime(18171): at co.uk.rushorm.core.implementation.ReflectionClassLoader.doLoop(ReflectionClassLoader.java:242) 02-18 09:37:35.929: E/AndroidRuntime(18171): at co.uk.rushorm.core.implementation.ReflectionClassLoader.addChildrenToList(ReflectionClassLoader.java:152) 02-18 09:37:35.929: E/AndroidRuntime(18171): at co.uk.rushorm.core.implementation.ReflectionClassLoader.loadClasses(ReflectionClassLoader.java:68) 02-18 09:37:35.929: E/AndroidRuntime(18171): at co.uk.rushorm.core.implementation.ReflectionClassLoader.loadClasses(ReflectionClassLoader.java:47) 02-18 09:37:35.929: E/AndroidRuntime(18171): at co.uk.rushorm.core.RushCore.load(RushCore.java:274) 02-18 09:37:35.929: E/AndroidRuntime(18171): at co.uk.rushorm.core.RushCore.access$100(RushCore.java:28) 02-18 09:37:35.929: E/AndroidRuntime(18171): at co.uk.rushorm.core.RushCore$2.callback(RushCore.java:123) 02-18 09:37:35.929: E/AndroidRuntime(18171): at co.uk.rushorm.android.AndroidRushQueProvider$1.run(AndroidRushQueProvider.java:41) 02-18 09:37:35.929: E/AndroidRuntime(18171): at java.lang.Thread.run(Thread.java:811)

    bug 
    opened by mrsasha 11
  • getId() returns NULL, resulting in not being able to delete objects?

    getId() returns NULL, resulting in not being able to delete objects?

    I have a java class Movie:

    public class Movie extends RushObject {
    
    private String tittel = "";
    private String format = "";
    
    public Movie() {
    }
    
    public Movie(String tittel, String format){
        this.tittel = tittel;
        this.format = format;
    }
    //...
    //getters, setters, equal & hashcode
    //...
    
    }
    

    I create a new Movie:

    Movie movie = new Movie("Thor","Blu-Ray");
    

    And saves it:

    movie.save(new RushCallback() {
       @Override
        public void complete() {
            Log.d("movie.save()",""+movie.getId());
            Snackbar.make(v, movie.getTittel() + " added.", Snackbar.LENGTH_LONG).show();
        }
    });
    

    Here movie.getId() returns a valid id.

    But.. When I at startup of application runs this:

    for (Movie movie : new RushSearch().orderAsc("tittel").find(Movie.class)) {
         Log.d("Found movie in DB", movie.getTittel());
         Log.d("Found movie in DB", "" + movie.getId());
    }
    

    movie.getId() is NULL:

    10-06 19:16:42.815 25729-25729/com.olavbg.android.filmbase D/Found movie in DB: Thor
    10-06 19:16:42.815 25729-25729/com.olavbg.android.filmbase D/Found movie in DB: null
    

    When trying to delete this movie the callback gets called, but I see no log entry from RushOrm. Also, on the next startup the movie is still there. RushCore.deleteAll(Movie.class) and RushCore.clearDatabase() works as expected.

    I searched and found this issue: https://github.com/Stuart-campbell/RushOrm/issues/14 So I tried overriding getId() in Movie.java:

    @Override
    public String getId() { return RushCore.getInstance().getId(this); }
    

    I have also tried this:

    movie.save(new RushCallback() {
       @Override
        public void complete() {
            Log.d("movie.save()",""+movie.getId());
            movie.setTempId(movie.getId());
            Snackbar.make(v, movie.getTittel() + " added.", Snackbar.LENGTH_LONG).show();
        }
    });
    

    And then when deleting:

    RushCore.getInstance().registerObjectWithId(movie, movie.getTempId());
    movie.delete();
    

    But still no luck. Am I doing something wrong?

    bug 
    opened by olavbg 10
  • DB version issue

    DB version issue

    This is most likely caused by a change in data structure or new RushObject. This issue should be resolved by a database migration. This can be done by updating db version number in the manifest or setting Rush in debug mode. To set Rush in debug mode add this to your manifest file -

    I have changed the DB version in the manifest but still I am facing same issue

    opened by ravisankit14 0
  • Error accessing native library in ART:Check failed: super_class->IsResolved()

    Error accessing native library in ART:Check failed: super_class->IsResolved()

    Native Crash when I receive a sms message in my test phone: 06-06 10:10:34.228 23802 23895 F art : vendor/intel/art-extension/runtime/class_linker.cc:5561] Check failed: super_class->IsResolved() 06-06 10:10:34.519 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] Runtime aborting... 06-06 10:10:34.519 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] Aborting thread: 06-06 10:10:34.519 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] "pool-7-thread-2" prio=5 tid=49 Runnable 06-06 10:10:34.519 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] | group="" sCount=0 dsCount=0 obj=0x1338dc10 self=0x7caee77cd000 06-06 10:10:34.519 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] | sysTid=23895 nice=0 cgrp=default sched=0/0 handle=0x7caecd303450 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] | state=R schedstat=( 437936092 3986747 31 ) utm=42 stm=1 core=3 HZ=100 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] | stack=0x7caecd201000-0x7caecd203000 stackSize=1037KB 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] | held mutexes= "abort lock" "mutator lock"(shared held) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #00 pc 00000000005bea78 /system/lib64/libart.so (_ZN3art15DumpNat iveStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+248) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #01 pc 0000000000593616 /system/lib64/libart.so (_ZNK3art6Thread9 DumpStackERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMap+406) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #02 pc 0000000000580afb /system/lib64/libart.so (_ZNK3art10AbortS tate10DumpThreadERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEPNS_6ThreadE+43) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #03 pc 0000000000580971 /system/lib64/libart.so (_ZNK3art10AbortS tate4DumpERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEE+561) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #04 pc 0000000000572e2d /system/lib64/libart.so (_ZN3art7Runtime5 AbortEv+125) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #05 pc 00000000001d2091 /system/lib64/libart.so (_ZN3art10LogMess ageD1Ev+817) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #06 pc 0000000000217a41 /system/lib64/libart.so (_ZN3art11ClassLi nker22LoadSuperAndInterfacesENS_6HandleINS_6mirror5ClassEEERKNS_7DexFileE+1057) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #07 pc 0000000000213e7f /system/lib64/libart.so (_ZN3art11ClassLi nker11DefineClassEPNS_6ThreadEPKcmNS_6HandleINS_6mirror11ClassLoaderEEERKNS_7DexFileERKNS9_8ClassDefE+671) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #08 pc 0000000000213a55 /system/lib64/libart.so (_ZN3art11ClassLi nker26FindClassInPathClassLoaderERNS_33ScopedObjectAccessAlreadyRunnableEPNS_6ThreadEPKcmNS_6HandleINS_6mirror11ClassLoaderEEEPPNS8_5ClassE+1733) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #09 pc 0000000000214982 /system/lib64/libart.so (_ZN3art11ClassLi nker9FindClassEPNS_6ThreadEPKcNS_6HandleINS_6mirror11ClassLoaderEEE+450) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #10 pc 00000000001f94fe /system/lib64/libart.so (_ZN3art11ClassLi nker11ResolveTypeERKNS_7DexFileEtNS_6HandleINS_6mirror8DexCacheEEENS4_INS5_11ClassLoaderEEE+190) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #11 pc 0000000000204b61 /system/lib64/libart.so (_ZN3art11ClassLi nker11ResolveTypeERKNS_7DexFileEtPNS_6mirror5ClassE+177) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #12 pc 00000000002176b5 /system/lib64/libart.so (_ZN3art11ClassLi nker22LoadSuperAndInterfacesENS_6HandleINS_6mirror5ClassEEERKNS_7DexFileE+149) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #13 pc 0000000000213e7f /system/lib64/libart.so (_ZN3art11ClassLi nker11DefineClassEPNS_6ThreadEPKcmNS_6HandleINS_6mirror11ClassLoaderEEERKNS_7DexFileERKNS9_8ClassDefE+671) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #14 pc 0000000000213a55 /system/lib64/libart.so (_ZN3art11ClassLi nker26FindClassInPathClassLoaderERNS_33ScopedObjectAccessAlreadyRunnableEPNS_6ThreadEPKcmNS_6HandleINS_6mirror11ClassLoaderEEEPPNS8_5ClassE+1733) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #15 pc 0000000000214982 /system/lib64/libart.so (_ZN3art11ClassLi nker9FindClassEPNS_6ThreadEPKcNS_6HandleINS_6mirror11ClassLoaderEEE+450) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #16 pc 00000000001f94fe /system/lib64/libart.so (_ZN3art11ClassLi nker11ResolveTypeERKNS_7DexFileEtNS_6HandleINS_6mirror8DexCacheEEENS4_INS5_11ClassLoaderEEE+190) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #17 pc 00000000001cc4aa /system/lib64/libart.so (_ZN3art11ClassLi nker11ResolveTypeEtPNS_9ArtMethodE+250) 06-06 10:10:34.520 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #18 pc 00000000003ac596 /system/lib64/libart.so (_ZN3art22Resolve VerifyAndClinitEjPNS_9ArtMethodEPNS_6ThreadEbb+70) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #19 pc 00000000006459a5 /system/lib64/libart.so (MterpNewInstance +69) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #20 pc 00000000001acd97 /system/lib64/libart.so (artMterpAsmInstr uctionStart+4375) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #21 pc 00000000003813ac /system/lib64/libart.so (_ZN3art11interpr eterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+284) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #22 pc 0000000000387ac9 /system/lib64/libart.so (_ZN3art11interpr eter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+169) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #23 pc 00000000003a69c6 /system/lib64/libart.so (_ZN3art11interpr eter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+742) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #24 pc 00000000001ab801 /system/lib64/libart.so (MterpInvokeStati c+353) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #25 pc 00000000001af519 /system/lib64/libart.so (artMterpAsmInstr uctionStart+14489) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #26 pc 00000000003813ac /system/lib64/libart.so (_ZN3art11interpr eterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+284) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #27 pc 0000000000387ac9 /system/lib64/libart.so (_ZN3art11interpr eter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+169) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #28 pc 00000000003a69c6 /system/lib64/libart.so (_ZN3art11interpr eter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+742) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #29 pc 00000000001ab801 /system/lib64/libart.so (MterpInvokeStati c+353) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #30 pc 00000000001af519 /system/lib64/libart.so (artMterpAsmInstr uctionStart+14489) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #31 pc 00000000003813ac /system/lib64/libart.so (_ZN3art11interpr eterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+284) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #32 pc 0000000000387ac9 /system/lib64/libart.so (_ZN3art11interpr eter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+169) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #33 pc 00000000003a69c6 /system/lib64/libart.so (_ZN3art11interpr eter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+742) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #34 pc 0000000000644d6e /system/lib64/libart.so (MterpInvokeVirtu alQuick+478) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #35 pc 00000000001b3119 /system/lib64/libart.so (artMterpAsmInstr uctionStart+29849) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #36 pc 00000000003813ac /system/lib64/libart.so (_ZN3art11interpr eterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+284) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #37 pc 0000000000387ac9 /system/lib64/libart.so (_ZN3art11interpr eter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+169) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #38 pc 00000000003a69c6 /system/lib64/libart.so (_ZN3art11interpr eter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+742) 06-06 10:10:34.521 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #39 pc 0000000000644d6e /system/lib64/libart.so (MterpInvokeVirtu alQuick+478) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #40 pc 00000000001b3119 /system/lib64/libart.so (artMterpAsmInstr uctionStart+29849) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #41 pc 00000000003813ac /system/lib64/libart.so (_ZN3art11interpr eterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+284) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #42 pc 0000000000387ac9 /system/lib64/libart.so (_ZN3art11interpr eter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+169) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #43 pc 00000000003a69c6 /system/lib64/libart.so (_ZN3art11interpr eter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+742) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #44 pc 000000000064276b /system/lib64/libart.so (MterpInvokeInter face+747) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #45 pc 00000000001af599 /system/lib64/libart.so (artMterpAsmInstr uctionStart+14617) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #46 pc 00000000003813ac /system/lib64/libart.so (_ZN3art11interpr eterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+284) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #47 pc 0000000000387ac9 /system/lib64/libart.so (_ZN3art11interpr eter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+169) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #48 pc 00000000003a69c6 /system/lib64/libart.so (_ZN3art11interpr eter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+742) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #49 pc 00000000001ab801 /system/lib64/libart.so (MterpInvokeStati c+353) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #50 pc 00000000001af519 /system/lib64/libart.so (artMterpAsmInstr uctionStart+14489) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #51 pc 00000000003813ac /system/lib64/libart.so (_ZN3art11interpr eterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+284) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #52 pc 0000000000387ac9 /system/lib64/libart.so (_ZN3art11interpr eter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+169) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #53 pc 00000000003a69c6 /system/lib64/libart.so (_ZN3art11interpr eter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+742) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #54 pc 00000000001ab801 /system/lib64/libart.so (MterpInvokeStati c+353) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #55 pc 00000000001af519 /system/lib64/libart.so (artMterpAsmInstr uctionStart+14489) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #56 pc 00000000003813ac /system/lib64/libart.so (_ZN3art11interpr eterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+284) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #57 pc 00000000001ab0d4 /system/lib64/libart.so (artQuickToInterp reterBridge+660) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #58 pc 00000000001c873c /system/lib64/libart.so (art_quick_to_int erpreter_bridge+140) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #59 pc 00000000001be046 /system/lib64/libart.so (art_quick_invoke _static_stub+806) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #60 pc 00000000001cbd93 /system/lib64/libart.so (_ZN3art9ArtMetho d6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+227) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #61 pc 000000000013aa87 /system/lib64/libart.so (_ZN3art11interpr eter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+263) 06-06 10:10:34.522 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #62 pc 00000000003a6952 /system/lib64/libart.so (_ZN3art11interpr eter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+626) 06-06 10:10:34.523 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] native: #63 pc 00000000001ab801 /system/lib64/libart.so (MterpInvokeStati c+353) 06-06 10:10:34.523 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] at org.mozilla.javascript.ScriptRuntime.initSafeStandardObjects(SourceFile :159) 06-06 10:10:34.523 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] at org.mozilla.javascript.ScriptRuntime.initStandardObjects(SourceFile:268 ) 06-06 10:10:34.523 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] at org.mozilla.javascript.Context.initStandardObjects(SourceFile:1143) 06-06 10:10:34.523 23802 23895 F art : vendor/intel/art-extension/runtime/runtime.cc:427] at org.mozilla.javascript.Context.initStandardObjects(SourceFile:1029)

    opened by elenaGuoAi 0
  • Issue in deleteAll

    Issue in deleteAll

    Hi Stuart,

    this takes about 30 ms
    

    List<Transaction_Data> data = new RushSearch().find(Transaction_Data.class); Timber.e("transactions count %s", data.size()); RushCore.getInstance().delete(data);

    but the below code is taking around 3-4 secs   `RushCore.getInstance().deleteAll(Transaction_Data.class);
    

    ' At all times i only have one entrance of Transaction_Data in the db

    opened by fcunhagrowandfit 0
  • whereIsNotNull is not computing relation field name

    whereIsNotNull is not computing relation field name

    Hello,

    First of all, thank you for this library ;)

    Just a quick one that fortunately has a fix but can be added to future updates:

    new RushSearch().startGroup().whereIsNotNull("user").and().whereEqual("user", user).endGroup().orderDesc("created").find(AssetModel.class);

    is "user" is a relation and it happens to return null, let's say we saved AssetModel with a null user at some point, then whereIsNotNull is only searching for a table primitive named "user", the where statement looks like this:

    WHERE (rush_uk_co_vicast_communityapp_model_AssetModel_rush_uk_co_vicast_communityapp_model_UserModel_user.child IS NOT NULL AND user='V8g95') and normally we should replace "user" with "rush_uk_co_vicast_communityapp_model_AssetModel_rush_uk_co_vicast_communityapp_model_UserModel_user.child" for the full query to work.

    A fast fix would be to calculate the "user" relation field name in advance like this:

    Map annotationCache = RushCore.getInstance().getAnnotationCache(); String userFieldName = ReflectionUtils.joinTableNameForClass(((AnnotationCache)annotationCache.get(AssetModel.class)).getTableName(), ((AnnotationCache)annotationCache.get(UserModel.class)).getTableName(), "user") + ".child";

    and then insert it into the query replacing "user" to userFieldName variable.

    Thank you, Alex

    opened by alez007 0
  • @RushList sort capability

    @RushList sort capability

    Maybe the possibility to add sorting for a @RushList annotated field would lead to a more elegant code ? For a one to many relationship, currently I cannot think of a different way to do this but ignore the relation in the field list and create a getter that does a sorted search.

    opened by alez007 0
A MySQL connector wrapper that supports mapping to Kotlin classes.

Racoon Racoon is a wrapper for the MySQL connector. It makes communicating with the database easier by providing a bunch of functionalities: Mapping q

null 1 Jun 3, 2022
Active record style SQLite persistence for Android

ActiveAndroid ActiveAndroid is an active record style ORM (object relational mapper). What does that mean exactly? Well, ActiveAndroid allows you to s

Michael Pardo 4.7k Dec 29, 2022
A blazing fast, powerful, and very simple ORM android database library that writes database code for you.

README DBFlow is fast, efficient, and feature-rich Kotlin database library built on SQLite for Android. DBFlow utilizes annotation processing to gener

Andrew Grosner 4.9k Dec 30, 2022
greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.

Check out ObjectBox Check out our new mobile database ObjectBox (GitHub repo). ObjectBox is a superfast object-oriented database with strong relation

Markus Junginger 12.6k Jan 3, 2023
Insanely easy way to work with Android Database.

Sugar ORM Insanely easy way to work with Android databases. Official documentation can be found here - Check some examples below. The example applicat

null 2.6k Dec 16, 2022
Android ORM

Shillelagh Shillelagh is an sqlite library. It was built to make life easier. The entire library was built around simplicity when using sqlite in Andr

Andrew Reitz 49 Sep 11, 2020
Compile-time active record ORM for Android

Ollie Compile-time active record ORM for Android. Multiple mapping methods. SQLiteDatabase-like interface (QueryUtils.java). Lightweight query builder

Michael Pardo 423 Dec 30, 2022
requery - modern SQL based query & persistence for Java / Kotlin / Android

A light but powerful object mapping and SQL generator for Java/Kotlin/Android with RxJava and Java 8 support. Easily map to or create databases, perfo

requery 3.1k Dec 29, 2022
A blazing fast, powerful, and very simple ORM android database library that writes database code for you.

README DBFlow is fast, efficient, and feature-rich Kotlin database library built on SQLite for Android. DBFlow utilizes annotation processing to gener

Andrew Grosner 4.9k Dec 30, 2022
Core Data for Android

NexusData Core Data for Android NexusData is an object graph and persistence framework for Android. It allows for organizing and managing relational d

Dia Kharrat 71 Nov 11, 2022
A simple NoSQL client for Android. Meant as a document store using key/value pairs and some rudimentary querying. Useful for avoiding the hassle of SQL code.

SimpleNoSQL A simple NoSQL client for Android. If you ever wanted to just save some data but didn't really want to worry about where it was going to b

Colin Miller 389 Sep 25, 2022
An Android library that makes developers use SQLite database extremely easy.

LitePal for Android 中文文档 LitePal is an open source Android library that allows developers to use SQLite database extremely easy. You can finish most o

Lin Guo 7.9k Dec 31, 2022
Active record style SQLite persistence for Android

ActiveAndroid ActiveAndroid is an active record style ORM (object relational mapper). What does that mean exactly? Well, ActiveAndroid allows you to s

Michael Pardo 4.7k Dec 29, 2022
Insanely easy way to work with Android Database.

Sugar ORM Insanely easy way to work with Android databases. Official documentation can be found here - Check some examples below. The example applicat

null 2.6k Jan 9, 2023
An Android helper class to manage database creation and version management using an application's raw asset files

THIS PROJECT IS NO LONGER MAINTAINED Android SQLiteAssetHelper An Android helper class to manage database creation and version management using an app

Jeff Gilfelt 2.2k Dec 23, 2022
Android SQLite API based on SQLCipher

Download Source and Binaries The latest AAR binary package information can be here, the source can be found here. Compatibility SQLCipher for Android

SQLCipher 2.6k Dec 31, 2022
ORMLite Android functionality used in conjunction with ormlite-core

ORMLite Android This package provides the Android specific functionality. You will also need to download the ormlite-core package as well. Users that

Gray 1.6k Dec 31, 2022
SquiDB is a SQLite database library for Android and iOS

Most ongoing development is currently taking place on the dev_4.0 branch. Click here to see the latest changes and try out the 4.0 beta. Introducing S

Yahoo 1.3k Dec 26, 2022
Sprinkles is a boiler-plate-reduction-library for dealing with databases in android applications

Sprinkles Sprinkles is a boiler-plate-reduction-library for dealing with databases in android applications. Some would call it a kind of ORM but I don

Emil Sjölander 781 Nov 28, 2022