What is KittyORM?
KittyORM is an Object-Relational Mapping library designed for use with Android and SQLite. It implements Data Mapper pattern design and its main purpose is to simplify interaction with SQLite database in Android applications. Written in Java 7 it supports devices from API level 9 Android.
Main features we want to achieve with KittyORM are:
- simple and clear API that handles database creation, version management and interaction with database tables;
- high flexibility of working with model POJO files via database mappers that grants you an ability to focus on your business processes not on working with raw SQL queries;
- full support of all features to create your SQLite schema via built-in annotations. That means that you can use all SQLite features described at SQLite documentation to create your schema only with usage of KittyORM annotations (indexes, constraints etc);
- flexible way to manage all things you may want to change or implement. Typical KittyORM database consists of database bootstrap class implementation that handles all actions to get all stuff working, database helper implementation and list of models and data mappers stored in map, all of those are friendly for customization;
- quite good performance speed of executing business logic that achieved with on start generation of database configuration that helps to avoid a lot of reflection calls.
Main idea of creating KittyORM is to offer a tool that would suit both people who want to use all power of SQLite and people who want just to work with simple database of few tables to store data without messing with raw SQL.
So, what KittyORM has right now?
- Full support of SQLite syntax to create a database schema implemented via KittyORM annotations.
- Supporting of mapping SQLite affinities to Java’s primitives, primitive wrappers and common objects such
BigIntegeretc. Also, enumerations supported as well as user defined mapping (for example,
- Basic CRUD controller that can handle all typical CRUD operations.
- Support of extending default CRUD controller.
QueryBuilderthat offers simple creation of some extended queries to be used standalone or as part of extended CRUD controller.
- POJO models inheritance supported, that means that you can use abstract POJO class that would be inherited in child implementations. Also, KittyORM supports temporary tables and non-schema POJO models (those models can be used for querying database but wouldn’t be used at schema generation).
- Multidomain support (e.g. you can use as many databases in your application as you want).
- Not bad performance. You can tune your KittyORM database to avoid a big amount of reflection calls by setting your KittyORM database class by your own and placing it into Android Application class instance.
- Support of database version management. KittyORM provides you three migration options:
- Ready for database encryption implementation.
- Simple but really flexible API. Practically, most components of KittyORM can be customized to suit your needs.
- Good documentation contains tutorial with code snippets, javadoc and demo application available at KittyORM project page.
Things to do in future releases:
- One-To-One and One-To-Many relation handling via implementing SQLite queries using
- KittyORM standalone static code generator application to provide generation of mappers and models based on KittyORM implementation that would not use reflection calls.
- Partial standalone database encryption with AES.
And some other features as well.