{"id":20127683,"url":"https://github.com/imangazalievm/reactiveandroid","last_synced_at":"2025-07-07T05:34:33.434Z","repository":{"id":82065243,"uuid":"108579191","full_name":"ImangazalievM/ReActiveAndroid","owner":"ImangazalievM","description":"🚀 Simple and powerful ORM for Android","archived":false,"fork":false,"pushed_at":"2020-08-11T21:03:16.000Z","size":581,"stargazers_count":98,"open_issues_count":19,"forks_count":18,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-06T18:46:50.061Z","etag":null,"topics":["activeandroid","android","database","orm","rxjava","sqlite","sqlite-android"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ImangazalievM.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-10-27T18:10:47.000Z","updated_at":"2024-12-19T10:13:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"500f6a1b-236b-4d7c-b925-c3b692ec6bfb","html_url":"https://github.com/ImangazalievM/ReActiveAndroid","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/ImangazalievM/ReActiveAndroid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImangazalievM%2FReActiveAndroid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImangazalievM%2FReActiveAndroid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImangazalievM%2FReActiveAndroid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImangazalievM%2FReActiveAndroid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ImangazalievM","download_url":"https://codeload.github.com/ImangazalievM/ReActiveAndroid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ImangazalievM%2FReActiveAndroid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264019942,"owners_count":23545241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["activeandroid","android","database","orm","rxjava","sqlite","sqlite-android"],"created_at":"2024-11-13T20:23:17.519Z","updated_at":"2025-07-07T05:34:33.410Z","avatar_url":"https://github.com/ImangazalievM.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo][logo]\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://travis-ci.org/ImangazalievM/ReActiveAndroid\"\u003e\u003cimg alt=\"Build Status\" src=\"https://api.travis-ci.org/ImangazalievM/ReActiveAndroid.svg?branch=master\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://bintray.com/imangazaliev/maven/reactiveandroid/_latestVersion\"\u003e\u003cimg alt=\"Download\" src=\"https://api.bintray.com/packages/imangazaliev/maven/reactiveandroid/images/download.svg\"/\u003e\u003c/a\u003e\n\u003cimg alt=\"minSdkVersion 14\" src=\"https://img.shields.io/badge/minSdkVersion-14-blue.svg\"/\u003e\n\u003ca href=\"https://opensource.org/licenses/MIT\"\u003e\u003cimg alt=\"License: MIT\" src=\"https://img.shields.io/badge/License-MIT-blue.svg\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eFull Documentation: \u003ca href=\"https://imangazalievm.gitbooks.io/reactiveandroid\"\u003eReActiveAndroid\u003c/a\u003e\u003c/strong\u003e\n\u003c/p\u003e\n\nReActiveAndroid is Android ORM based on popular library [ActiveAndroid](https://github.com/pardom/ActiveAndroid). Unfortunately, the author of the library stopped maintaining it, so I decided to continue maintain the library instead of him.\n\nNew features in ReActiveAndroid in comparison with ActiveAndroid:\n\n- multiple databases support\n- more convenient migration mechanism\n- a new and improved syntax for creating SQL queries\n- One-to-Many relation\n- inherited models\n- table/model change notifications\n- RxJava 2 support\n- fixed bugs and more\n\nIn the plans:\n\n- Annotation Processing instead of Java Reflection\n- improved compatibility with Kotlin\n- composite primary key support\n- SQL Cipher support\n- AutoValue support\n\n\n## Installation\n\nAdd this to your app **build.gradle**:\n\n```gradle\nimplementation 'com.reactiveandroid:reactiveandroid:1.4.3'\n```\n\n## Initial setup\n\nFirst, we need to create a database class:\n\n```java\n@Database(name = \"MyDatabase\", version = 1)\npublic class AppDatabase {\n\n}\n```\n\nIn the `@Database` annotation  we specified the name of the database without an extension and the version of the schema.\n\nNext, we need to initialize the library in the `onCreate` method of the Application class:\n\n```java\nDatabaseConfig appDatabase = new DatabaseConfig.Builder(AppDatabase.class)\n        .build();\n\nReActiveAndroid.init(new ReActiveConfig.Builder(this)\n        .addDatabaseConfigs(appDatabase)\n        .build());\n```\n\n## Creating tables\n\nTo create a table, we need to create a model class that inherits from the `Model` class and annotate it with `@Table`:\n\n```java\n@Table(name = \"Notes\", database = AppDatabase.class)\npublic class Note extends Model {\n\n    @PrimaryKey\n    private Long id;\n    @Column(name = \"title\")\n    private String title;\n    @Column(name = \"text\")\n    private String text;\n\n    public Note(String title, String text) {\n        this.title = title;\n        this.text = text;\n    }\n\n    public Long getId() {\n        return id;\n    }\n\n    public void setTitle(String title) {\n        this.title = title;\n    }\n\n    public String getTitle() {\n        return title;\n    }\n\n    public void setText(String text) {\n        this.text = text;\n    }\n\n    public String getText() {\n        return text;\n    }\n\n}\n```\n\nIn the `@Table` annotation we specify table name and the database class in which the table belongs. Also you can create a model class without inheritance from the `Model`, but then you will not have access to `save()` and `delete()` methods.\n\nNow we can save, update and delete records:\n\n```java\nNote note = new Note(\"Title\", \"Text\");\nnote.save();\n\nnote.setText(\"New text\");\nnote.save();\n\nnote.delete();\n```\n\n## Query building\n\nBuilding a query in ReActiveAndroid is like building a normal SQL statement:\n\n```java\n//inserting record\nInsert.into(Note.class).columns(\"title\", \"text\").values(\"Title\", \"Text\").execute();\n\n//getting all table records\nList\u003cNote\u003e notes = Select.from(Note.class).fetch();\n\n//getting a specific record\nNote note = Select.from(Note.class).where(\"id = ?\", 1).fetchSingle();\n\n//getting a selection of records\nList\u003cNote\u003e notes = Select.from(Note.class).where(\"title = ?\", \"title\").fetch();\n\n//updating record\nUpdate.table(Note.class).set(\"title = ?\", \"New title\").where(\"id = ?\", 1).execute();\n\n//deleting record\nDelete.from(Note.class).where(\"id = ?\", 1).execute();\n```\n\n## License\n\n```\nThe MIT License\n\nCopyright (c) 2017-2018 Mahach Imangazaliev\n\nPermission 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:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n```\n\n[logo]: https://raw.githubusercontent.com/ImangazalievM/ReActiveAndroid/master/art/logo.png\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimangazalievm%2Freactiveandroid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimangazalievm%2Freactiveandroid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimangazalievm%2Freactiveandroid/lists"}