ORMLite
Encyclopedia
ORMLite is an open source software
framework that provides lightweight object relational mapping (ORM)
between Java
classes and SQL
database
s. It supports JDBC databases as well as Android mobile
platform. The software project was started with the goal of providing a simple yet powerful wrapper around the JDBC functions without the complexity of other frameworks such as Hibernate
and iBATIS
.
ORMLite supports JDBC connections to MySQL
, PostgreSQL
, Microsoft SQL Server
, H2
, Derby
, HSQLDB
, and SQLite
and can be extended to additional databases relatively easily. There are also initial implementations for DB2
and Oracle
. It has a separate database backend which also supports native database calls on Android OS. You can contact the author of ORMLite if your database is not supported.
Open-source software
Open-source software is computer software that is available in source code form: the source code and certain other rights normally reserved for copyright holders are provided under a software license that permits users to study, change, improve and at times also to distribute the software.Open...
framework that provides lightweight object relational mapping (ORM)
Object-relational mapping
Object-relational mapping in computer software is a programming technique for converting data between incompatible type systems in object-oriented programming languages. This creates, in effect, a "virtual object database" that can be used from within the programming language...
between Java
Java
Java is an island of Indonesia. With a population of 135 million , it is the world's most populous island, and one of the most densely populated regions in the world. It is home to 60% of Indonesia's population. The Indonesian capital city, Jakarta, is in west Java...
classes and SQL
SQL
SQL is a programming language designed for managing data in relational database management systems ....
database
Database
A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality , in a way that supports processes requiring this information...
s. It supports JDBC databases as well as Android mobile
Mobile phone
A mobile phone is a device which can make and receive telephone calls over a radio link whilst moving around a wide geographic area. It does so by connecting to a cellular network provided by a mobile network operator...
platform. The software project was started with the goal of providing a simple yet powerful wrapper around the JDBC functions without the complexity of other frameworks such as Hibernate
Hibernate (Java)
Hibernate is an object-relational mapping library for the Java language, providing a framework for mapping an object-oriented domain model to a traditional relational database...
and iBATIS
IBATIS
iBATIS is a persistence framework which automates the mapping between SQL databases and objects in Java, .NET, and Ruby on Rails. In Java, the objects are POJOs . The mappings are decoupled from the application logic by packaging the SQL statements in XML configuration files...
.
ORMLite supports JDBC connections to MySQL
MySQL
MySQL officially, but also commonly "My Sequel") is a relational database management system that runs as a server providing multi-user access to a number of databases. It is named after developer Michael Widenius' daughter, My...
, PostgreSQL
PostgreSQL
PostgreSQL, often simply Postgres, is an object-relational database management system available for many platforms including Linux, FreeBSD, Solaris, MS Windows and Mac OS X. It is released under the PostgreSQL License, which is an MIT-style license, and is thus free and open source software...
, Microsoft SQL Server
Microsoft SQL Server
Microsoft SQL Server is a relational database server, developed by Microsoft: It is a software product whose primary function is to store and retrieve data as requested by other software applications, be it those on the same computer or those running on another computer across a network...
, H2
H2 (DBMS)
H2 is a relational database management system written in Java. It can be embedded in Java applications or run in the client-server mode. The disk footprint is about 1 MB....
, Derby
Apache Derby
Apache Derby is a relational database management system developed by the Apache Software Foundation that can be embedded in Java programs and used for online transaction processing. It has a 2 MB disk-space footprint.Apache Derby is developed as an open source project under the Apache 2.0 license...
, HSQLDB
HSQLDB
HSQLDB is a relational database management system written in Java. It has a JDBC driver and supports a large subset of SQL-92 and SQL:2008 standards. It offers a fast, small database engine which offers both in-memory and disk-based tables...
, and SQLite
SQLite
SQLite is an ACID-compliant embedded relational database management system contained in a relatively small C programming library. The source code for SQLite is in the public domain and implements most of the SQL standard...
and can be extended to additional databases relatively easily. There are also initial implementations for DB2
IBM DB2
The IBM DB2 Enterprise Server Edition is a relational model database server developed by IBM. It primarily runs on Unix , Linux, IBM i , z/OS and Windows servers. DB2 also powers the different IBM InfoSphere Warehouse editions...
and Oracle
Oracle Database
The Oracle Database is an object-relational database management system produced and marketed by Oracle Corporation....
. It has a separate database backend which also supports native database calls on Android OS. You can contact the author of ORMLite if your database is not supported.
Features
ORMLite provides the following features:- You configure your databaseDatabaseA database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality , in a way that supports processes requiring this information...
classes by simply adding JavaJavaJava is an island of Indonesia. With a population of 135 million , it is the world's most populous island, and one of the most densely populated regions in the world. It is home to 60% of Indonesia's population. The Indonesian capital city, Jakarta, is in west Java...
annotations. Configuration using code or Spring also works. - Tables are accessed with powerful abstract Data Access ObjectData Access ObjectIn computer software, a data access object is an object that provides an abstract interface to some type of database or persistence mechanism, providing some specific operations without exposing details of the database. It provides a mapping from application calls to the persistence layer...
classes. - A flexible database querySelect (SQL)The SQL SELECT statement returns a result set of records from one or more tables.A SELECT statement retrieves zero or more rows from one or more database tables or database views. In most applications, SELECT is the most commonly used Data Manipulation Language command...
builder is provided with which you can easily construct simple and complex queries. - You can compileCompilerA compiler is a computer program that transforms source code written in a programming language into another computer language...
SQLSQLSQL is a programming language designed for managing data in relational database management systems ....
statements for repetitive query tasks. - Basic support for database transactionDatabase transactionA transaction comprises a unit of work performed within a database management system against a database, and treated in a coherent and reliable way independent of other transactions...
s. - Create and drop database tables with the help of statements generated by the framework.
- Spring framework configurations are supported for your DOAs and classes.
External links
- ORMLite home page with online documentation and examples
- SourceForge project page for ORMLite with downloads and bug tracking
- ORMLite users mailing list for asking questions of the user community
- Android OS support information