• Stars
    star
    577
  • Rank 77,363 (Top 2 %)
  • Language
    Java
  • License
    ISC License
  • Created over 11 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Core ORMLite functionality that provides a lite Java ORM in conjunction with ormlite-jdbc or ormlite-android

ORMLite Core

This package provides the core functionality for the JDBC and Android packages. Users that are connecting to SQL databases via JDBC should download the ormlite-jdbc package instead which includes these core classes. Android users should download the ormlite-android package instead which also includes these core classes.

ORMLite is easy to use and provides the following features:

Enjoy, Gray Watson

Code Example

The following is a quick code example to give you a taste on how to use the library.

// this uses h2 but you can change it to match your database
String databaseUrl = "jdbc:h2:mem:account";
// create a connection source to our database
ConnectionSource connectionSource = new JdbcConnectionSource(databaseUrl);

// instantiate the DAO to handle Account with String id
Dao<Account,String> accountDao = DaoManager.createDao(connectionSource, Account.class);

// if you need to create the 'accounts' table make this call
TableUtils.createTable(connectionSource, Account.class);

// create an instance of Account
String name = "Jim Smith";
Account account = new Account(name, "_secret");

// persist the account object to the database
accountDao.create(account);

// retrieve the account
Account account2 = accountDao.queryForId(name);
// show its password
System.out.println("Account: " + account2.getPassword());

// close the connection source
connectionSource.close();

Logging Information

ORMLite has copied in logging code from SimpleLogging which backends to a number of different logging systems and is configurable via code or configuration. For more details see the logging documentation.

Maven Configuration

For JDBC usage, you should depend on Maven Central which includes the core classes.

<dependency>
	<groupId>com.j256.ormlite</groupId>
	<artifactId>ormlite-jdbc</artifactId>
	<version>6.1</version>
</dependency>

For Android usage, you should depend on Maven Central which includes the core classes.

<dependency>
	<groupId>com.j256.ormlite</groupId>
	<artifactId>ormlite-android</artifactId>
	<version>6.1</version>
</dependency>

ChangeLog Release Notes

See the ChangeLog.txt file.

More Repositories

1

ormlite-android

ORMLite Android functionality used in conjunction with ormlite-core
Java
1,588
star
2

two-factor-auth

Two Factor Authentication Java code implementing the Time-based One-time Password Algorithm
Java
313
star
3

ormlite-jdbc

ORMLite JDBC functionality that works with JDBC drivers to attach to various database types
Java
224
star
4

simplemagic

Simple file magic number and content-type library which provides mime-type determination from files and byte arrays
Java
218
star
5

ormlite-examples

Various example programs
Java
181
star
6

dmalloc

Debug Malloc memory allocation debugging C library
C
159
star
7

simplejmx

Simple JMX Java Library to help with the publishing of objects using JMX and the web
Java
92
star
8

cloudwatch-logback-appender

Appender that publishes logback log entries to AWS CloudWatch
Java
55
star
9

simplecsv

Simple Java CSV reading and writing library using Java annotations
Java
24
star
10

perl-two-factor-auth

Two Factor Authentication Perl code
Perl
13
star
11

ormlite-tests

More extensive unit tests
Java
6
star
12

simplelogging

Simple Java logging facade which can backend into a number of different logging implementations and is designed to be copied into another project.
Java
5
star
13

simplezip

Java processing of Zip files that gives full control over all Zip disk structures
Java
5
star
14

simplemetrics

Simple Java metrics for counting and publishing metrics from Java applications
Java
3
star
15

test-check-publisher-maven-plugin

Maven plugin designed to take tests results produced by continuous integration systems and publish them to github as a "check" annotation on a particular commit.
Java
2
star
16

simple-web-framework

Simple web framework for providing annotation based web request handling
Java
2
star
17

ormlite-android-tests

Android specific tests for the emulator.
Java
2
star
18

mailgw

Mailgw Issues and Feature Requests
1
star
19

sortu

Unit sort command-line utility with the ability to count unique entries inline. Also includes some cut features to handle fields.
C
1
star
20

null

Unix command line utility which combines /dev/null, tree, md5sum, and other useful features.
C
1
star