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

Overview

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();

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.

Comments
  • Exception raised on non-foreign field about maxForeignAutoRefreshLevel and foreignAutoRefresh

    Exception raised on non-foreign field about maxForeignAutoRefreshLevel and foreignAutoRefresh

    I'm using a build of ormlite-core from master (commit e653256eefe6ada8bf6a8fe9b52a5d85ac549142) on Android.

    I'm getting this runtime exception when creating a table:

    java.lang.IllegalArgumentException: Field address1 has maxForeignAutoRefreshLevel set (2) but not foreignAutoRefresh is false
            at com.j256.ormlite.field.FieldType.<init>(FieldType.java:273)
            at com.j256.ormlite.table.DatabaseTableConfig.convertFieldConfigs(DatabaseTableConfig.java:249)
            at com.j256.ormlite.table.DatabaseTableConfig.extractFieldTypes(DatabaseTableConfig.java:116)
    

    The relevant field has this definition:

    @DatabaseField
    private String address1;
    

    In 4b3a3dda9d07c83c7afa4519f3eb2e642ededbd7 , you changed how the default recursion level is injected. Does this now change the level for all fields? Should there be a check that the field is actually a foreign one?

    This problem never occurred for me when using ormlite-core 4.4.8 . I don't ever set the refresh level in my models.

    opened by efung 26
  • master branch build error (javax.persistence dependency) on ubuntu

    master branch build error (javax.persistence dependency) on ubuntu

    I'm trying to build the master branch of ormlite-core (and ormlite-android) because I need the new commits about CursorLoader and CursorAdapter.

    I use ubuntu 14.04. I just cloned the github repo and launched mvn install.

    Here is what I get : JavaxPersistenceImpl.java:[6,24] error: package javax.persistence does not exist.

    I saw in the pom that the javax.persistence dependency has the scope "test". It may be the cause of the issue. If it is, how did you build until now ?!!

    opened by VincentJousse 15
  • Change generic class type to wildcard i.e. support polymorphism

    Change generic class type to wildcard i.e. support polymorphism

    For a more flexible polymorphic design it is preferable to do this

    MyClass myInstance;

    Dao<Object, Integer> dao = getHelper().getDao(myInstance.getClass()); dao.update(myInstance);

    than use a hard-code class type like this

    MyClass myInstance;

    Dao<MyClass, Integer> dao = getHelper().getDao(MyClass.class); dao.update(myInstance);

    The proposed change set allows this.

    opened by todoooo 14
  • Connection leak when working with ForeignCollectionField using Stream API

    Connection leak when working with ForeignCollectionField using Stream API

    Given a class:

    public class Transaction {
        ...
    
        @ForeignCollectionField(foreignFieldName = "transaction")
        private Collection<Document> documents;
    }
    

    And then working with it using Stream API leaves the acquired connections behind. Happens in number of ways, but simple way to reproduce is:

    Transaction transaction = dao.queryForId(id);
    Document document = transaction.getDocuments().stream().findFirst().get();
    
    final int numberOfConnections = 3;
    
    // 1 connection for dao.queryForId. And 2! more created during java.util.Spliterators.IteratorSpliterator#estimateSize
    verify(connectionSource, times(numberOfConnections)).getReadOnlyConnection(any());
    
    // Expecting that all connections where released, but actually one connection was not (one of the connections acquired during IteratorSpliterator#estimateSize remains acquired)
    verify(connectionSource, times(numberOfConnections)).releaseConnection(any());
    

    Reproduced with ormlite 5.6

    opened by zhemaituk 12
  • Investigating odd stack trace from TableInfo.getFieldTypeByColumnName()

    Investigating odd stack trace from TableInfo.getFieldTypeByColumnName()

    I'm a little lost trying to figure out the root cause, figured maybe you'd have some idea...

    We're running ORMLite on Android, and a few times a day, we're seeing a call to TableInfo.getFieldTypeByColumnName() fail in a seemingly impossible manner:

    Caused by java.lang.IllegalArgumentException: You should use columnName 'name' for table organizations instead of fieldName 'name'
           at com.j256.ormlite.table.TableInfo.getFieldTypeByColumnName(TableInfo.java:168)
           at com.j256.ormlite.stmt.StatementBuilder.verifyColumnName(StatementBuilder.java:195)
           at com.j256.ormlite.stmt.QueryBuilder.addSelectColumnToList(QueryBuilder.java:662)
           at com.j256.ormlite.stmt.QueryBuilder.selectColumns(QueryBuilder.java:117)
    

    I'm not sure how you can end up in this state. Based on my reading of getFieldTypeByColumnName(), it essentially:

    1. Creates a Map<ColumnName, FieldType> for the table.
    2. Tries to return the FieldType that matches the provided ColumnName.
    3. If it fails, it tries to figure out if maybe you provided a FieldName instead of a ColumnName.

    That all seems reasonable to me; however, in the stack trace it shows the same FieldName and ColumnName. If the error-checking for-loop can find the right FieldType, then why doesn't the Map<ColumnName, FieldType> have it?


    We get this crash only intermittently, not consistently, so it's not something fundamentally wrong with the calling code. I suspect some sort of concurrency issue, though I don't see anything obviously wrong here. It could be something with the oddities of SMP on Android. Perhaps the Map creation needs to be synchronized?

    We've know we've seen this since ORMLite 5.3, though it's possible we saw it earlier than that (it's just that our crash logs don't go back that far).

    Any ideas on how this could happen?

    opened by dlew 12
  • UUID_NATIVE does not seem to work with Postgres

    UUID_NATIVE does not seem to work with Postgres

    Hello, After I saw the support for UUID native fields, I switched to the 5.0 release. But it seems either it doesn't work or I'm missing something. I have a pojo class with a java.util.UUID ID field and the annotation

    @DatabaseField( generatedId=true, dataType=DataType.UUID_NATIVE )

    my database has the field

    "id" uuid not null primary key default uuid_generate_v4()

    but when I try to save an object with

    dao.create( myObj )

    then I have a PSQLException column "id" is of type uuid but expression is of type character varying.

    If I add readOnly = true to the @DatabaseField, then the insert works, but the ID returned by my object after the .create() is not the ID saved in the database.

    Am I doing something bad? Is it possible to handle UUID auto-generated ID values on the database ?

    opened by akaoj 11
  • Crash on  QueryBuilder.orderBy() when changing device language to Turkish

    Crash on QueryBuilder.orderBy() when changing device language to Turkish

    Hi @j256

    I'm currently using ormlite-core 5.0 and getting a crash on QueryBuilder.orderBy(). My order by column is not being recognized when the language of the device is being set to Turkish.

    Here's part of the stack trace:

    java.lang.IllegalArgumentException: You should use columnName 'providedId' for table trip instead of fieldName 'providedId' at com.j256.ormlite.table.TableInfo.getFieldTypeByColumnName(TableInfo.java:151) at com.j256.ormlite.stmt.StatementBuilder.verifyColumnName(StatementBuilder.java:183) at com.j256.ormlite.stmt.QueryBuilder.orderBy(QueryBuilder.java:176) at com.mttnow.android.bcd.persistence.dao.TripDao.getQueryBuilder(TripDao.java:151) at com.mttnow.android.bcd.persistence.dao.TripDao.queryForAllOrdered(TripDao.java:84)

    Related to https://github.com/j256/ormlite-core/issues/67

    Thank you.

    opened by cezarvancea 9
  • CreateOrUpdate on Entity with id which is CustomType doesn't work

    CreateOrUpdate on Entity with id which is CustomType doesn't work

    Hi

    I have suspicion that on fields which are id and are custom type operation create or update doesn't work. Maybe I configured something wrong. Don't want to paste some code snippets. So I've created project which has this situation.

    https://github.com/issue-example/ormlite.git on branch issue/create_or_update_on_custom_type

    opened by lstrzelecki 9
  • Strange behavior when passing SelectArg for orderByRaw().

    Strange behavior when passing SelectArg for orderByRaw().

    I am re-posting this issue here on github, as there is already an open question in SO. I stumbled upon some strange behavior regarding orderByRaw. I was trying to model this query, which resembles a distinct:

    SELECT `occupation` FROM `cards` GROUP BY `occupation` ORDER BY `occupation` IS NULL ASC.
    

    In a populated database, this query should group by the occupation value, and order by the IS NULL value. IS NULL is either 1 or 0, which depends on whether the value is null or not correspondingly. Now if you order by IS NULL value ascending, then you ask SQL to return all the zeroes first, and all the ones in the end, literally giving a result of NULLS in the end. In order to model the above query using ORMlite, I did this:

    String column = "occupation"; //This comes from an unknown source
    SelectArg selectArg = new SelectArg(SqlType.STRING, column);
    qBuilder.selectColumns(column).groupBy(column).orderByRaw("? IS NULL ASC", selectArg);
    

    Apparently one should expect the null values to be returned after all the non-null ones, but instead the query seems to be run as is:

    SELECT * FROM `cards` GROUP BY `occupation` ORDER BY ? IS NULL ASC.
    

    The above query is a perfectly valid one. I've never seen a logically valid usage of ? in this context but still it's syntactically correct, and therefore the driver just accepts it without errors, but the ordering is unaffected. I created a JUnit test with an assert test in my github. You can check it here.

    opened by gogos-venge 8
  • Feature request: auto upgrade schema

    Feature request: auto upgrade schema

    Keeping track of changes to classes, maintaining a version number and writing manual 'scripts' in onUpgrade() is error-prone and becomes unwieldy as the number of releases grows.

    OrmLite could automate this to varying extents. Initially for add/remove columns, and probably also for changing data type or size where the data is compatible.

    An initial implementation could compare the 'create table' statement generated from the Class with the current database table structure and if there is any mismatch: rename the table, create a new table, copy all the data across, then delete the old renamed table.

    Later enhancements could analyse the mismatches and generate 'alter table' statements for faster operation but the above might be acceptable for many applications in the meantime.

    opened by molexx 8
  • Bump log4j-api from 2.0-beta4 to 2.16.0

    Bump log4j-api from 2.0-beta4 to 2.16.0

    Bumps log4j-api from 2.0-beta4 to 2.16.0.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 7
  • Multiple object instances due to foreign reference cycles?

    Multiple object instances due to foreign reference cycles?

    I've got a scenario where a DatabaseTable A has an eager ForeignCollectionField referring to table B, which has a foreign DatabaseField referring to table C, which has a foreign field referring back to table A. When querying for an uncached instance of A, I'm seeing:

    1. Check the cache (weak ReferenceObjectCache) for a cached instance when mapping rows and return it https://github.com/j256/ormlite-core/blob/master/src/main/java/com/j256/ormlite/stmt/mapped/BaseMappedQuery.java#L49 otherwise:
    2. Create a new instance https://github.com/j256/ormlite-core/blob/master/src/main/java/com/j256/ormlite/stmt/mapped/BaseMappedQuery.java#L54
    3. Iterate resultsFieldTypes https://github.com/j256/ormlite-core/blob/master/src/main/java/com/j256/ormlite/stmt/mapped/BaseMappedQuery.java#L58
    4. Recursively assign fields, eventually calling createForeignObject to create a new instance of A while iterating the fields on an instance of C https://github.com/j256/ormlite-core/blob/master/src/main/java/com/j256/ormlite/field/FieldType.java#L574
    5. The instance of A from step 4 is hydrated and added to the object cache https://github.com/j256/ormlite-core/blob/master/src/main/java/com/j256/ormlite/field/FieldType.java#L1077
    6. The instance of A from step 2 is added to the object cache https://github.com/j256/ormlite-core/blob/master/src/main/java/com/j256/ormlite/stmt/mapped/BaseMappedQuery.java#L94

    At this point I've got the instance of A from step 2 (and 6) in my object cache along with an instance of C that has a foreign DatabaseField referring to the instance of A from step 4.

    I could avoid this particular scenario by lowering maxForeignAutoRefreshLevel on either B's reference to C or C's reference to A, but we add columns to our data model often and I'd rather not consider these possible cycles each time we do this!

    So my question is: would it make sense to modify BaseMappedQuery mapRow() to add newly-created instances to the object cache prior to resolving foreign references (i.e., between steps 2 and 3 above)? That way (I think) the subsequent mapRow calls for the foreign references would be find the cached instance from step 2 rather than creating a new instance?

    I can also imagine that it might be a bad idea to add partially-hydrated instances to the object cache, so this idea may be a nonstarter!

    opened by ewills 1
  • Issue with exponents in numbers being dropped when using `updateRaw` with Postgres

    Issue with exponents in numbers being dropped when using `updateRaw` with Postgres

    I used using an updateRaw statement of the form:

    marketOrdersDao.updateRaw(
        "INSERT INTO market_orders_temp " + "(" + columnList + ") " + "VALUES " + "(?, ?, ?, ?, ?, ?,...)",
        ... snip ...
        order.getPrice().toString(), // getPrice() returns Double
        ... snip ...
    );
    

    For some values of price, specifically ones with exponents, such as 7.527E7. The value would end up in the database as 7.527.

    The database in question is my local testing database: PostgreSQL 13.2, compiled by Visual C++ build 1914, 64-bit. However, I didn't see the issue on my production DB PostgreSQL 13.4 on x86_64-redhat-linux-gnu, compiled by gcc (GCC) 11.2.1 20211203 (Red Hat 11.2.1-7), 64-bit. Both running the same version of ormlite.

    If it's relevant, market_orders_temp is a temp table created within the same transaction (ie, not the same table as the dao that updateRaw is called on).

    I was able to work around the issue by using a CompiledStatement directly:

    try {
    	CompiledStatement compiledStatement = connection.compileStatement(
    	  "INSERT INTO market_orders_temp (" + columnList + ") VALUES (?, ?, ?, ?, ?, ?, ...)",
    	  StatementBuilder.StatementType.UPDATE,
    	  new FieldType[0],
    	  DatabaseConnection.DEFAULT_RESULT_FLAGS,
    	  false);
    
    	try {
    		// Insert changed orders into temporary table
    		for (MarketOrdersResponse order : changedOrders) {
    ... snip ...												
    		compiledStatement.setObject(6, order.getPrice(), SqlType.DOUBLE);
    ... snip ...
    		}
    	} finally {
    		IOUtils.closeThrowSqlException(compiledStatement, "compiled statement");
    	}
    } finally {
    	database.getConnectionSource().releaseConnection(connection);
    }
    

    I'm thinking this is some oddity with converting strings to numbers with specific database versions, or possibly differing JDKs?

    opened by kcbanner 11
  • One-to-one relationship should be established in ORMLite

    One-to-one relationship should be established in ORMLite

    image

    image

    I need an annotation like @ForeignCollectionField which is for single object @ForeignSingletonField. I tried to make a one-to-one relationship with javax.persistence annotation with my knowledge from jpa, but I guess ormlite doesn't support persistence annotation enough.

    If this ormlite is also not possible I'm calling out to the ORMLite developers. It would be great if you add @ForeignSingletonField annotation .

    The annatation I want you to add corresponds to @OneToOne in JPA

    opened by birolozturkk 2
  • ormlite-jdbc and ormlite-android can no longer be used together

    ormlite-jdbc and ormlite-android can no longer be used together

    As I understand it, the recent changes to ORMLite 6.x packages (via shading) the core library.

    However, this means that you can no longer use both the JDBC and Android versions side-by-side. This causes compilation issues because the same core classes are included twice.

    The reason we do this is because in the main app, we use ormlite-android; but in tests, we use ormlite-jdbc.

    opened by dlew 5
Releases(ormlite-core-6.1)
  • ormlite-core-6.1(Dec 20, 2021)

  • ormlite-core-6.0(Dec 18, 2021)

    • ALL: Added support for Java 7. Dropped support for Java 6.
    • ALL: Migrated to supporting AutoCloseable. Most close() methods now throw Exception not IOException.
    • CORE: Removed some deprecated methods that had been with us for a while.
    • CORE: Added closeable-spliterator for better handing of JDK8+ streams. Thanks to zhemaituk.
    • CORE: Add Dao.queryForFirst() convenience method.
    • JDBC: ormlite-jdbc jar now includes the -core classes. No need to import ormlite-core jar anymore.
    • JDBC: Fixed exceptions in some JDBC drivers when working with chars. Thanks to Bo98.
    • JDBC: Fixed support for creating index IF NOT EXISTS in MariaDb. Thanks to BluemediaGER.
    • JDBC: Fixed boolean char type handling in Derby.
    • ANDROID: ormlite-android jar now includes the -core classes. No need to import ormlite-core jar anymore.
    Source code(tar.gz)
    Source code(zip)
  • ormlite-core-5.7(Nov 8, 2021)

    • CORE: Fixed possible thread issue around field-name lookups. Thanks to dlew.
    • CORE: Fixed a number of flaky tests based on field order. Thanks CharlesZKQ, NanaOkada, hwang-pku, and chimo173.
    • CORE: Upgraded SimpleLogging code to fix annoying startup messages. Thanks to JayDi85.
    • CORE: Removed broken getCreateTableStatements(DatabaseType, ...). ConnectionSource needed. Thanks to blacatena.
    • CORE: Added WrappedConnectionSource and other support classes for tracing unclosed connections and statements.
    • CORE: Added better support for JDK8+ streams with lazy foreign collections. Thanks to zhemaituk.
    • ANDROID: Fixed bug in number rows affected with executeUpdateDelete() in newer API versions. Thanks to WonShaw.
    Source code(tar.gz)
    Source code(zip)
  • ormlite-core-5.6(Jun 22, 2021)

    • CORE: Added support for @Entity storing of Serializable types. Thanks to arn-cpu.
    • CORE: Fixed a bug with nonreentrant handling of DateFormat. Thanks to Bob Lacatena.
    • ANDROID: Removed the reflection hack support for pre-ice-cream-sandwich annotation performance.
    Source code(tar.gz)
    Source code(zip)
  • ormlite-core-5.5(May 23, 2021)

  • ormlite-core-5.4(May 19, 2021)

    • CORE: Added LoggerFactory.setLogFactory() for supporting other log implementations and added NullLog.
    • CORE: Migrated the internal logging code to SimpleLogging.
    • CORE: Updated H2 version which shook lose a couple of issues in tests and core support.
    • CORE: Added UPDATE and DELETE database-dependent support for TOP and LIMIT. Thanks to juur.
    • JDBC: Fixed NPE in JdbcSingleConnectionSource because of early initialization. Thanks to Nexxxt99.
    • JDBC: Fixed problem in Postgresql where mixed case sequence names aren't handled right. Thanks to Nick.
    • JDBC: Added database dependent login-timeout seconds setting to the JdbcConnectionSource.
    Source code(tar.gz)
    Source code(zip)
  • ormlite-core-5.3(Dec 9, 2020)

    • CORE: More improvements to the TransactionManager connection and savepoint handling.
    • CORE: Added a getInternalConnection() method to DatabaseConnection to access underlying objects.
    • CORE: Added support for ORDER BY ... NULLS FIRST and LAST. May not be supported by all database types.
    • CORE: Added optimization to AND and OR queries to reduce the parens in the generated query. Thanks to devjta.
    • CORE: Removed some extraneous spaces from generated queries.
    • CORE: Added missing wiring for the TIME_STAMP_STRING data type for storing Timestamp type as a string.
    • CORE: Added support for OneToMany JPA annotation. Thanks to Bo98.
    • JDBC: Update the DB2 driver class. Thanks to mauro-palumbo.
    • JDBC: Added support for create table if not exists for HSQLDB versions 2.3.X and greater. Thanks to lukewhitt.
    • JDBC: Fixed a problem with H2's handling of boolean fields.
    • JDBC: Fixed the log4j logger classes broken in 5.2. Also moved them over to core. Thanks to MarcMil.
    Source code(tar.gz)
    Source code(zip)
    ormlite-android-5.3.jar(68.51 KB)
    ormlite-core-5.3.jar(338.14 KB)
    ormlite-jdbc-5.3.jar(67.01 KB)
  • ormlite-core-5.2(Dec 31, 2020)

    • JDBC: Refactored the JDBC package to make it java9 compliant by moving all classes under jdbc subpackage.
    • CORE: Added support for @DatabaseField(readOnly) boolean for returning non-column fields.
    • CORE: Added @DatabaseField(fullColumnDefinition) for fully describing a column as opposed to columnDefinition.
    • CORE: Added BaseSchemaUtil to print out the schema statements necessary to create a table.
    • CORE: Added the ability for users to set a character set for byte array type. Thanks to noordawod.
    • CORE: Added a Logger.setGlobalLogLevel(...) method to set a global filter on all log messages.
    • CORE: Moved from RETURN_GENERATED_KEYS to named columns for generated ids to be more compatible. Thanks to Bo98.
    • CORE: Significant refactoring to make FieldType and TableInfo not depend on Dao or ConnectionSource.
    • CORE: Improved memory usage by unregistering DAOs associated to a connection source. Thanks to bosborn.
    • CORE: Fixed problem with null field assignment causing a NPE in the resulting message. Thanks to hrach.
    • CORE: Fixed problems with the transaction level thread-local not being handled right. Thanks to Bo98.
    • CORE: Fixed @DatabaseField(fullColumnDefinition) which was completely broken. Thanks to ethanmdavidson.
    • CORE: Fixed default width not being applied for BigInteger. Thanks to Bo98.
    • CORE: Fixed the default mysql driver and made driver loading more forgiving. Thanks to zanella.
    • CORE: Fixed a couple of incorrect SqlTypes in field converters. Thanks to Bo98.
    • CORE: Support schema name qualifiers for tables. Thanks to Fedor Bobin.
    • CORE: Fixed concurrency issues when using iterators. Thanks to MarcMil.
    Source code(tar.gz)
    Source code(zip)
  • ormlite-core-5.1(Dec 31, 2020)

    • CORE: Added synchronized keyword to BaseDaoImpl.createOrUpdate() and createIfNotExists().
    • CORE: Added integer date support. Thanks to noordawod.
    • CORE: Added support for CloseableIterator.moveAbsolute(...). Thanks to renaudcerrato.
    • CORE: Fixed but with get table name not using TableInfo. Thanks to 0xabadea.
    • CORE: Fixed handling of field capitalization which was screwing up Turkish fields. Thanks to folkyatina.
    • CORE: Fixed handling of joined queries with orders and group by's. Thanks much to p91paul.
    • CORE: Fixed bad bug with committing of inner transactions inappropriately. Thanks much to maroux.
    • CORE: Normalized all of the up/down case usage to the DatabaseType so it can be overridden.
    • JDBC: Fixed problem with UUID native type not using the correct persister. Thanks to Bo98.
    • ANDROID: Added field sorting for more deterministic config file output. Thanks to jibidus.
    Source code(tar.gz)
    Source code(zip)
  • ormlite-core-5.0(Dec 31, 2020)

    • ALL: ORMLite has dropped support for Java 5. Java 6 is now required.
    • ALL: Added boolean argument to DatabaseConnection.compileStatement(...) to fix a cache bug.
    • ALL: Changed DatabaseResults.getObjectCache() to be getObjectCacheForRetrieve() and getObjectCacheForStore().
    • CORE: Added JOIN-ing between tables without a foreign-object relationship.
    • CORE: Added TimeStampStringType to support Android timestamps.
    • CORE: Added the ability to override the DataPersister as well as the FieldConverter.
    • CORE: Added support for the @Table entity from javax.persistence annotations. Thanks to wener. Bug #174.
    • CORE: Added used of java.io.Closeable to support CloseableIterator and other Java7 support. Thanks to livelazily.
    • CORE: Added Dao.create(Collection) method for bulk creation. Thanks to Farrukh Najmi for the good idea.
    • CORE: Added DataType.BOOLEAN_CHAR (to support '1' '0' or 't' 'f') and BOOLEAN_INTEGER. Thanks to stew.
    • CORE: Added support for QueryBuilder.countOf("DISTINCT(field)"). Thanks to spacetime.
    • CORE: Added support for Java 8 methods. Thanks to VincentFTS.
    • CORE: Added support for Joda DateTime to be able to be a version field. Thanks much to outofrange.
    • CORE: Added support for raw queries using the DatabaseResults in the mapper. Thanks much to nonameplum.
    • CORE: Added support for ENUM_TO_STRING type which persists Enum.toString() instead of name(). Thanks jiajia-li.
    • CORE: Added support for BigInteger to be an ID and version field by saving as string. Thanks noordawod.
    • CORE: Added support for BYTE_ARRAY and STRING_BYTE_ARRAY data type for ids and default values. Thanks noordawod.
    • CORE: Added support for table aliasing. Thanks much to p91paul.
    • CORE: Added table-name for many ConnectionSource methods to allow partitioning and other per-table operations.
    • CORE: Added better support for per-database type object custom persisters. Thanks to rzorzorzo.
    • CORE: Fixed (really) QueryBuilder.orderByRaw(...), orderBy(...) mutually exclusivity. Thanks to Diederik. Bug #161.
    • CORE: Fixed a bug when we select columns on an entity without an id field. Thanks to lder.
    • CORE: Fixed a bug with building queries using selectRaw(...). Bug #166.
    • CORE: Fixed the javax.persistence annotation processing and revamped it to use the annotations directly.
    • CORE: Fixed bug with UpdateBuilder methods returning wrong type. Thanks to Joseph Jones. Bug #180.
    • CORE: Fixed bug with the raw results that they are not obeying the AS SQL. Thanks to nonameplum. Bug #183.
    • CORE: Fixed bug with ISNULL and ISNOTNULL which weren't working with serializable. Thanks to andrew8er. Bug #185.
    • CORE: Fixed bug with dao.update() not setting dao on BaseDaoEnabled instances. Thanks to Carlos Fonseca. Bug #177.
    • CORE: Fixed bug where dao.deleteById(...) was not being properly notified. Thanks to Daniel Jette. Bug #190.
    • CORE: Fixed bug where useGetSet did not understand isXxx() for boolean fields. Thanks to HeDYn. Bug #187.
    • CORE: Fixed finding of get/set/is methods if not in English locale. Thanks to Christian Ruppert. Bug #191.
    • CORE: Fixed bug with Doa.createOrUpdate(...) and custom id types. Thanks much to lstrzelecki. Bug #193.
    • CORE: Fixed some problems with default-value parsing and handing with some complex types.
    • CORE: Fixed synchronization problems with single connection ConnectionSource and Dao.callBatchTasks(). Bug #195.
    • CORE: Fixed bad bug where max-auto-refresh value enabled auto-refresh when programmatically configured. Bug #196.
    • CORE: Fixed bug where unknown enum name was not working with anonymous enum types. Thanks to jahd2602. Bug #197.
    • CORE: Fixed a bug where the logger did not handle an array of primitives correctly.
    • CORE: Fixed problem with capitalization of entities in non-english locales. ENGLISH now the default.
    • CORE: Fixed problems with using @DatabaseField(foreignColumnName). Thanks to Knight704.
    • CORE: Fixed problem with storing partially formed objects in cache because of select arguments. Thanks to pimduin.
    • CORE: Fixed a bug in DatabaseFieldConfig constructor where it was ignoring DataType param. Thanks to magicgoose.
    • CORE: Removed deprecated methods: Dao.setAutoCommit(boolean), isAutoCommit()
    • CORE: Removed deprecated methods: QueryBuilder.clear(), limit(int), offset(int), use long versions of methods
    • CORE: Removed deprecated methods: ForeignCollectionField.maxEagerForeignCollectionLevel(), foreignColumnName()
    • CORE: Removed deprecated methods: DatabaseFieldConfig.setMaxEagerForeignCollectionLevel()
    • CORE: Removed deprecated methods: DatabaseFieldConfig.setForeignCollectionMaxEagerForeignCollectionLevel()
    • CORE: Removed deprecated methods: DatabaseFieldConfig.setForeignCollectionOrderColumn()
    • CORE: Removed deprecated methods: DatabaseFieldConfig.setForeignCollectionForeignColumnName()
    • JDBC: Added support for UUID database fields for Postgres, MSSQL. Use dataType = UUID_NATIVE. Thanks to tsharp.
    • JDBC: Added support for a JdbcConnectionSource that uses an existing database connection. Thanks to natinusala.
    • JDBC: Fixed (possibly) some problems with the Oracle type with better boolean support. Thanks to 51mon.
    • JDBC: Removed deprecated method: DataSourceConnectionSource.setUsesTransactions(boolean).
    • JDBC: Removed deprecated method: JdbcPooledConnectionSource.setUsesTransactions(boolean).
    • ANDROID: Added initial take on Loader base classes from EgorAnd for newer Android versions. Thanks much!!
    • ANDROID: Added better support for Slf4jLoggingLog from JDBC to CORE for Android users. Thanks to tonyxiao.
    • ANDROID: Fixed the string processing when persisting java.sql.Timestamp and java.sql.Date classes. Bug #163.
    • ANDROID: Fixed problem with the maxForeignAutoRefreshLevel config setting. Thanks to Eric Fung et al. Bug #194.
    • ANDROID: Fixed possible problem with queryForFirst() and improper LIMIT implementation.
    • ANDROID: Removed deprecated methods: OpenHelperManager.release(), AndroidDatabaseResults(Cursor, boolean, ObjectCache).
    Source code(tar.gz)
    Source code(zip)
  • ormlite-core-4.48(Dec 31, 2020)

    • CORE: Added support for tracking direct database connection activity with DatabaseConnectionProxy.
    • CORE: Fixed problem when inserting no columns to Sqlite (Android), other DBs. Thanks to Michael Weimann. Bug #155.
    • CORE: Added support for canceling of long running prepared queries. Thanks to Nathan Jones.
    • CORE: More aggressively remove of some ThreadLocal data. Thanks to Pavel Arnošt.
    • CORE: Fixed problem with queries similar to and().not().like(...). Thanks to ????. Bug #159.
    • CORE: Added better use of object cache when hydrating foreign fields. Thanks to Anthony Whitlock. Feature #38.
    • ANDROID: Added initial API compatibility code for handling multiple API versions. Needed to support canceling.
    Source code(tar.gz)
    Source code(zip)
Owner
Gray
Java hacker. C hacker in a previous life.
Gray
esProc SPL is a scripting language for data processing, with well-designed rich library functions and powerful syntax, which can be executed in a Java program through JDBC interface and computing independently.

esProc esProc is the unique name for esProc SPL package. esProc SPL is an open-source programming language for data processing, which can perform comp

null 990 Dec 27, 2022
光 HikariCP・A solid, high-performance, JDBC connection pool at last.

HikariCP It's Faster.Hi·ka·ri [hi·ka·'lē] (Origin: Japanese): light; ray. Fast, simple, reliable. HikariCP is a "zero-overhead" production ready JDBC

Brett Wooldridge 17.7k Jan 1, 2023
Vibur DBCP - concurrent and dynamic JDBC connection pool

Vibur DBCP is concurrent, fast, and fully-featured JDBC connection pool, which provides advanced performance monitoring capabilities, including slow S

Vibur 94 Apr 20, 2022
JDBC driver for ClickHouse

This is a basic and restricted implementation of jdbc driver for ClickHouse. It has support of a minimal subset of features to be usable.

ClickHouse 1.1k Jan 1, 2023
Multi-DBMS SQL Benchmarking Framework via JDBC

BenchBase BenchBase (formerly OLTPBench) is a Multi-DBMS SQL Benchmarking Framework via JDBC. Table of Contents Quickstart Description Usage Guide Con

CMU Database Group 213 Dec 29, 2022
SPRING MySQL Database Connection using JDBC STEPS

SPRING-MySQL-Database-Connection-using-JDBC-STEPS SPRING MySQL Database Connection using JDBC STEPS Step1: Create maven project Group id: com.cdac Art

Dnyaneshwar Madhewad 1 Jan 27, 2022
Amazon AppFlow Custom JDBC Connector example

Amazon AppFlow Custom JDBC Connector example This project contains source code and supporting files that implements Amazon Custom Connector SDK and re

AWS Samples 6 Oct 26, 2022
Online Quiz system - JDBC, JSP

Online-Quiz-System-in-Java Online Quiz system - JDBC, JSP Java Project based on JDBC, JSP, Java Servlet and Server Deployment Project Aim Develop web

Muhammad Asad 6 Oct 14, 2022
Hi, Spring fans! In this installment, we'll look at how to build tenancy-aware JDBC applications

Multitenant JDBC You'll need to spin up two separate PostgreSQL instances. Put this script into a file called postgres.sh: #!/usr/bin/env bash NAME=${

Spring Tips 19 Nov 7, 2022
A JDBC driver for Cloudflare's D1 product, compatible with Jetbrains tools.

D1 JDBC Driver A JDBC driver for Cloudflare's D1 Database product! JDBC is the technology that drives popular database tools such as Jetbrains' databa

Isaac McFadyen 21 Dec 9, 2022
Speedment is a Stream ORM Java Toolkit and Runtime

Java Stream ORM Speedment is an open source Java Stream ORM toolkit and runtime. The toolkit analyzes the metadata of an existing SQL database and aut

Speedment 2k Dec 21, 2022
A zero ceremony ORM for Java

Release notes Welcome Persism is a wood simple, auto discovery, auto configuration, and convention over configuration ORM (Object Relational Mapping)

Dan Howard 121 Dec 17, 2022
A lightweight and performant Java ORM alternative.

LightORM A lightweight and performant Java ORM alternative. LightORM has annotation processors so that all the integration code with the database is g

Jailson Pereira 14 Nov 22, 2022
A simple-to-use storage ORM supporting several databases for Java.

Storage Handler This is a library based off of my old storage handler within my queue revamp. It's for easy storage handling for multiple platforms. N

NV6 7 Jun 22, 2022
sql2o is a small library, which makes it easy to convert the result of your sql-statements into objects. No resultset hacking required. Kind of like an orm, but without the sql-generation capabilities. Supports named parameters.

sql2o Sql2o is a small java library, with the purpose of making database interaction easy. When fetching data from the database, the ResultSet will au

Lars Aaberg 1.1k Dec 28, 2022
Dcl372-2022-jan-04 - DCL-372: Core Spring 5

DCL-372: Core Spring 5 These projects are created as part of the following training: DCL-372 "Core Spring 5" Please follow the link for the complete t

Binnur KURT 3 Jan 10, 2022
SceneView is a 3D/AR Android View with ARCore and Google Filament. This is the newest way to make your Android 3D/AR app.

SceneView is a 3D/AR Android View with ARCore and Google Filament This is Sceneform replacement Features Use SceneView for 3D only or ArSceneView for

SceneView Open Community 235 Jan 4, 2023
MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.

MapDB: database engine MapDB combines embedded database engine and Java collections. It is free under Apache 2 license. MapDB is flexible and can be u

Jan Kotek 4.6k Dec 30, 2022
MapDB provides concurrent Maps, Sets and Queues backed by disk storage or off-heap-memory. It is a fast and easy to use embedded Java database engine.

MapDB: database engine MapDB combines embedded database engine and Java collections. It is free under Apache 2 license. MapDB is flexible and can be u

Jan Kotek 4.6k Jan 1, 2023