{"id":22472727,"url":"https://github.com/zoff99/sorma2","last_synced_at":"2026-04-18T00:02:25.260Z","repository":{"id":233263890,"uuid":"786397053","full_name":"zoff99/sorma2","owner":"zoff99","description":"Simple ORM(Android) based on https://github.com/maskarade/Android-Orma","archived":false,"fork":false,"pushed_at":"2026-03-28T19:10:28.000Z","size":209409,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-28T21:06:23.843Z","etag":null,"topics":["android","desktop","generator","java","jdbc","jvm","linux","macos","orm","sqlcipher","sqlite","windows"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zoff99.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"custom":["https://liberapay.com/zoff/donate","https://blockstream.info/address/1TRifA7eNLHZEcCTj43eYVWHBbLqTuXkS","https://buy.stripe.com/6oE00FbLieDMc7ecMN"]}},"created_at":"2024-04-14T10:39:06.000Z","updated_at":"2026-03-28T19:10:17.000Z","dependencies_parsed_at":"2024-05-01T11:30:51.671Z","dependency_job_id":"8495a18b-8e1e-4d63-9ab9-81d40c6f9842","html_url":"https://github.com/zoff99/sorma2","commit_stats":null,"previous_names":["zoff99/sorma2"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/zoff99/sorma2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoff99%2Fsorma2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoff99%2Fsorma2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoff99%2Fsorma2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoff99%2Fsorma2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zoff99","download_url":"https://codeload.github.com/zoff99/sorma2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zoff99%2Fsorma2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31950891,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["android","desktop","generator","java","jdbc","jvm","linux","macos","orm","sqlcipher","sqlite","windows"],"created_at":"2024-12-06T12:17:03.941Z","updated_at":"2026-04-18T00:02:25.245Z","avatar_url":"https://github.com/zoff99.png","language":"Java","funding_links":["https://liberapay.com/zoff/donate","https://blockstream.info/address/1TRifA7eNLHZEcCTj43eYVWHBbLqTuXkS","https://buy.stripe.com/6oE00FbLieDMc7ecMN"],"categories":[],"sub_categories":[],"readme":"# Sorma\u003csup\u003e2\u003c/sup\u003e - Simple ORM(Android)\u003csup\u003e2\u003c/sup\u003e \u003csub\u003e(also for Desktop)\u003csub\u003e\n\nsorma2 is a two-phase ORM system that generates Java code from annotated schema definitions during development, then uses that generated code at runtime for database operations.\u003cbr\u003e\n\nIt is based on the wonderful https://github.com/maskarade/Android-Orma by [FUJI Goro](https://github.com/gfx)\n\u003cbr\u003e\n\u003cbr\u003e\nThis is a rewrite in pure java, to generate most stuff you need and then add it to your project\neither as a ```.jar file``` or as ```java source```.\u003cbr\u003e\nYou still need to add ```sqlite-jdbc-3.51.3.0.jar``` to your project to use it.\u003cbr\u003e\n\u003cbr\u003e\u003cbr\u003e\n~~sadly [sqlite-jdbc](https://github.com/xerial/sqlite-jdbc) project decided that it needs ```slf4j-api jar``` (for no good reason).~~\nthis was solved by: https://github.com/xerial/sqlite-jdbc/pull/1178\n\u003cbr\u003e\u003cbr\u003e\nsee: https://github.com/xerial/sqlite-jdbc/issues/1094\u003cbr\u003e\n\u003cbr\u003e\n\n[![build](https://github.com/zoff99/iocipher_pack/actions/workflows/ci.yml/badge.svg)](https://github.com/zoff99/iocipher_pack/actions/workflows/ci.yml)\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.en.html)\n[![Liberapay](https://img.shields.io/liberapay/goal/zoff.svg?logo=liberapay)](https://liberapay.com/zoff/donate)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/zoff99/sorma2)\n\n\u003cimg src=\"https://raw.githubusercontent.com/zoff99/sorma2/refs/heads/master/sorma2_coms.png\" width=\"300\"\u003e\n\n## What is Sorma2?\n\nsorma2 is a pure Java code generator designed for efficient SQLite database access. It is suitable for both Android and Desktop Java applications.\n\n- **Purpose:** Generates Java source code for SQLite ORM based on schema definition files.\n- **Approach:** Unlike runtime ORMs, Sorma2 generates all necessary code at development time, avoiding reflection overhead and ensuring compile-time type safety.\n\n\n## Architecture\n\n### 1. Development Phase\n- Developers write schema files prefixed with `_sorm_`.\n- Schema files contain annotated Java class definitions.\n- The **Generator** class processes these files to produce complete ORM implementation code.\n\n### 2. Runtime Phase\n- The generated code offers a fluent API for database operations.\n- Platform-specific JDBC drivers handle actual SQLite communication.\n\n\n## Key Characteristics\n\n- **No Reflection at Runtime:** Improves performance and type safety.\n- **Readable Java Source Code:** Generated code is clear and maintainable.\n- **Type-safe Query Building API:** Ensures compile-time correctness.\n- **Support for Encrypted Databases:** Compatible with SQLCipher.\n- **Multi-threaded Operation:** Supports WAL mode for concurrency.\n- **Cross-platform Compatibility:** Works on Android API 21+ and Desktop Java 17+.\n\n\n# Usage\n\ncreate one file for each database table that you need.\n\u003cbr\u003e\ncreate file for db table `Person` as `./gen/_sorm_Person.java`\n\u003cbr\u003e(don't worry it is not really Java, we just use the syntax here)\n```Java\n@Table\npublic class Person\n{\n    @PrimaryKey(autoincrement = true)\n    public long id;\n    @Column\n    public String name;\n    @Column\n    public String address;\n    @Column\n    public int social_number;\n}\n```\n\nnow create the Java sources with the Java SORMA2 Generator. \u003cb\u003eyou need at least java 17\u003c/b\u003e.\u003cbr\u003e\n```bash\njava -classpath \".:sqlite-jdbc-3.51.3.0.jar:sorma2.jar\" \\\n  com/zoffcc/applications/sorm/Generator \"gen\"\n```\n\nyour project is now ready to start.\u003cbr\u003e\nenter the generator directory:\n```bash\ncd ./gen/\nls -al\n```\n\nnow move or copy all *.java files from the generator directory into your Android or Java project source tree\n```bash\ncd gen/\n# remove class files\nfind . -name '*.class'|xargs rm -v\ncp -av ./com /home/user/your/project/source/tree/\n```\n\nin your Java project you will need the `sqlite jdbc jar` and in your\nAndroid project you will need `com.github.zoff99:pkgs_zoffccAndroidJDBC` from [jitpack.io](https://jitpack.io/#zoff99/pkgs_zoffccAndroidJDBC)\n\nadd this dependency to your `build.gradle` file\n\n```\nimplementation 'com.github.zoff99:pkgs_zoffccAndroidJDBC:1.0.24'\n```\n\n\nAndroid Example App:\n------------------------\n\nsee: https://github.com/zoff99/sorma2/tree/master/example_android\n\n\u003cimg src=\"https://github.com/zoff99/sorma2/releases/download/nightly/android_screen01_21.png\" height=\"300\"\u003e\u003c/a\u003e\u003cimg src=\"https://github.com/zoff99/sorma2/releases/download/nightly/android_screen01_29.png\" height=\"300\"\u003e\u003c/a\u003e\u003cimg src=\"https://github.com/zoff99/sorma2/releases/download/nightly/android_screen01_33.png\" height=\"300\"\u003e\u003c/a\u003e\u003cimg src=\"https://github.com/zoff99/sorma2/releases/download/nightly/android_screen01_35.png\" height=\"300\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n\n\nLinux Java Example App:\n------------------------\n\nsee: https://github.com/zoff99/sorma2/tree/master/test\n\n\u003cimg src=\"https://github.com/zoff99/sorma2/releases/download/nightly/console_screen.png\" width=\"70%\"\u003e\n\nUse the `sorma_generated.jar` (that is generated in the `gen` directory) and `sqlite-jdbc-3.51.3.0.jar` for the Java project.\u003cbr\u003e\nCheck `TestSorma.java` for an Example usage.\n\u003cbr\u003e\n\nDesktop (Linux / Windows / macOS) Gradle Example Project\n------------------------\nsee: https://github.com/zoff99/sorma2/tree/master/example_gradle_linux\n\u003cbr\u003e\n\n\n\u003cbr\u003e\nAny use of this project's code by GitHub Copilot, past or present, is done\nwithout our permission.  We do not consent to GitHub's use of this project's\ncode in Copilot.\n\u003cbr\u003e\nNo part of this work may be used or reproduced in any manner for the purpose of training artificial intelligence technologies or systems.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoff99%2Fsorma2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzoff99%2Fsorma2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzoff99%2Fsorma2/lists"}