Hibernate's core Object/Relational Mapping functionality

Overview

Hibernate ORM is a library providing Object/Relational Mapping (ORM) support to applications, libraries, and frameworks.

It also provides an implementation of the JPA specification, which is the standard Java specification for ORM.

This is the repository of its source code; see Hibernate.org for additional information.

Build Status Language grade: Java

Continuous Integration

Hibernate uses both Jenkins and GitHub Actions for its CI needs. See

Building from sources

The build requires at least Java 11 JDK.

Hibernate uses Gradle as its build tool. See the Gradle Primer section below if you are new to Gradle.

Contributors should read the Contributing Guide.

See the guides for setting up IntelliJ or Eclipse as your development environment.

Gradle Primer

The Gradle build tool has amazing documentation. 2 in particular that are indispensable:

  • Gradle User Guide is a typical user guide in that it follows a topical approach to describing all of the capabilities of Gradle.

  • Gradle DSL Guide is unique and excellent in quickly getting up to speed on certain aspects of Gradle.

We will cover the basics developers and contributors new to Gradle need to know to get productive quickly.

Note
The project defines a Gradle Wrapper. The rest of the section will assume execution through the wrapper.

Executing Tasks

Gradle uses the concept of build tasks (equivalent to Ant targets or Maven phases/goals). You can get a list of available tasks via

gradle tasks

To execute a task across all modules, simply perform that task from the root directory. Gradle will visit each sub-project and execute that task if the sub-project defines it. To execute a task in a specific module you can either:

  1. cd into that module directory and execute the task

  2. name the "task path". For example, to run the tests for the hibernate-core module from the root directory you could say gradle hibernate-core:test

Common tasks

The common tasks you might use in building Hibernate include:

  • build - Assembles (jars) and tests this project

  • compile - Performs all compilation tasks including staging resources from both main and test

  • jar - Generates a jar archive with all the compiled classes

  • test - Runs the tests

  • publishToMavenLocal - Installs the project jar to your local maven cache (aka ~/.m2/repository). Note that Gradle never uses this, but it can be useful for testing your build with other local Maven-based builds.

  • clean - Cleans the build directory

Testing and databases

Testing against a specific database can be achieved in 2 different ways:

Using the "Matrix Testing Plugin" for Gradle.

Coming later…

Using "profiles"

The Hibernate build defines several database testing "profiles" in databases.gradle. These profiles can be activated by name using the db build property which can be passed either as a JVM system prop (-D) or as a Gradle project property (-P). Examples below use the Gradle project property approach.

gradle clean build -Pdb=pgsql

To run a test from your IDE, you need to ensure the property expansions happen. Use the following command:

gradle clean compile -Pdb=pgsql

NOTE: If you are running tests against a JDBC driver that is not available via Maven central be sure to add these drivers to your local Maven repo cache (~/.m2/repository) or (better) add it to a personal Maven repo server

Running database-specific tests from the IDE using "profiles"

You can run any test on any particular database that is configured in a databases.gradle profile.

All you have to do is run the following command:

gradlew setDataBase -Pdb=pgsql

or you can use the shortcut version:

gradlew sDB -Pdb=pgsql

You can do this from the module which you are interested in testing or from the hibernate-orm root folder.

Afterward, just pick any test from the IDE and run it as usual. Hibernate will pick the database configuration from the hibernate.properties file that was set up by the setDataBase Gradle task.

Starting test databases locally as docker containers

You don’t have to install all databases locally to be able to test against them in case you have docker available. The script docker_db.sh allows you to start a pre-configured database which can be used for testing.

All you have to do is run the following command:

./docker_db.sh postgresql_9_5

omitting the argument will print a list of possible options.

When the database is properly started, you can run tests with special profiles that are suffixed with _ci e.g. pgsql_ci for PostgreSQL. By using the system property dbHost you can configure the IP address of your docker host.

The command for running tests could look like the following:

gradlew test -Pdb=pgsql_ci "-DdbHost=192.168.99.100"

The following table illustrates a list of commands for various databases that can be tested locally.

Database docker_db.sh Gradle command

H2

-

gradlew test -Pdb=h2

HSQLDB

-

gradlew test -Pdb=hsqldb

Apache Derby

-

gradlew test -Pdb=derby

MySQL 5.7

./docker_db.sh mysql_5_7

gradlew test -Pdb=mysql_ci

MySQL 8.0

./docker_db.sh mysql_8_0

gradlew test -Pdb=mysql_ci

MariaDB

./docker_db.sh mariadb

gradlew test -Pdb=mariadb_ci

PostgreSQL 9.5

./docker_db.sh postgresql_9_5

gradlew test -Pdb=pgsql_ci

PostgreSQL 13

./docker_db.sh postgresql_13

gradlew test -Pdb=pgsql_ci

EnterpriseDB

./docker_db.sh edb

gradlew test -Pdb=edb_ci

Oracle XE

./docker_db.sh oracle

gradlew test -Pdb=oracle_ci

Oracle EE

./docker_db.sh oracle_ee

gradlew test -Pdb=oracle_docker

DB2

./docker_db.sh db2

gradlew test -Pdb=db2_ci

SQL Server

./docker_db.sh mssql

gradlew test -Pdb=mssql_ci

Sybase ASE

./docker_db.sh sybase

gradlew test -Pdb=sybase_ci

SAP HANA

./docker_db.sh hana

gradlew test -Pdb=hana_ci

CockroachDB

./docker_db.sh cockroachdb

gradlew test -Pdb=cockroachdb

Comments
  • [WIP] HHH-14180 Update h2 database from 1.4.197 to 2.0.x

    [WIP] HHH-14180 Update h2 database from 1.4.197 to 2.0.x

    ~~https://hibernate.atlassian.net/browse/HHH-14031~~ Rescoped as agreed here: https://github.com/hibernate/hibernate-orm/pull/3412#issuecomment-679156850 Ticket is now: https://hibernate.atlassian.net/browse/HHH-14180

    ⚠️ This is work in progess as it will need many adjustments and discussions. This PR will grow gradually.

    cc @tkalmar

    opened by famod 62
  • Add package for Micrometer MeterBinder support

    Add package for Micrometer MeterBinder support

    After discussion with @Sanne , create a project that brings support for Micrometer MeterBinders closer to hibernate source. This first pass brings the 1.6.1 MeterBinder implementations over to work against hibernate 5.4.

    Note this is a draft, one of many things to be sorted is how best to test this so we know it is doing what we want it to.

    • https://hibernate.atlassian.net/browse/HHH-14337
    opened by ebullient 40
  • HHH-12993 - Omit joining of superclass table when querying subclass only

    HHH-12993 - Omit joining of superclass table when querying subclass only

    • it go through AST and find out which tables are referenced. If super class table in "joined" inheritance strategy is not referenced, is is not joined
    • when any filter is active then all super class table are joined, because filter can reference them and I can not find it out from query AST analyze. It could be optimized probably somehow.
    opened by ladislavovic 34
  • HHH-8732 Upgraded Ehcache to 2.7.5

    HHH-8732 Upgraded Ehcache to 2.7.5

    This not only addresses HHH-8732, but actually upgrades the ehcache dependency to a newer stable release, 2.7.4, which isn't compatible (compile & runtime) with older releases (new stats API & some config changes, as covered by HHH-8732)

    opened by alexsnaps 30
  • HHH-5409: Implement PersistentBad.equals as intended in Collections

    HHH-5409: Implement PersistentBad.equals as intended in Collections

    Implements an equals with bag semantics.

    I have some tests in org.hibernate.jpa.test.cdi are failing, but they are also failing on master, so I think those are false positives (or would that be false negatives?).

    Requires clarifications 
    opened by JasperHorn 29
  • HHH-11266 Spring Cache 2nd-level cache

    HHH-11266 Spring Cache 2nd-level cache

    Provides support for Spring Cache as a Hibernate 2nd level cache by adapting Spring Cache to jcache and building on the work done in https://hibernate.atlassian.net/browse/HHH-10770

    I'm looking forward to feedback and guidance - thank you!

    Requires clarifications 
    opened by candrews 28
  • Various fixes for 6.0

    Various fixes for 6.0

    Changes:

    • Handle funky Derby casting requirements
    • Change binder to ignore precision < 1 to fix float type on DBs that support specifying a precision for float
    • Extend CastTarget to support casting from/to YesNoBoolean, TrueFalseBooleanType, NumericBooleanType and BooleanType to/from String and Integer types in a consistent manner.
    • Create emulation for LEAST/GREATEST
    • Fix overlay emulation issues for Derby due to strict substring handling
    • Properly implement WEEK and DAY_OF_WEEK extraction for Derby
    • Fix sequence support for Derby
    • Support translating same SqmParameter instance multiple times => Needed for e.g. Derby to emulate the OVERLAY function
    • Add some keywords for SQL Template to support more SQL expressions for @Formula
    • Introduce DialectContext for caching Dialect to use for dialect precondition checks, which is independent of SessionFactory used for tests. This fixes a circularity problem in dialect check extensions
    • Fix a few tests and fix issues encountered while testing MariaDB
    • Consider size 255 for UUID, Character and Boolean as "default JPA size"
    • Fix support for updating associations to null through DML queries
    6.0 
    opened by beikov 25
  • HHH-14469 - Support schema-tooling on sub-sets of the relational mode…

    HHH-14469 - Support schema-tooling on sub-sets of the relational mode…

    HHH-14469 - Support schema-tooling on sub-sets of the relational model known to Hibernate HHH-14470 - Support "hiding" domain references from sources other than ORM

    opened by sebersole 24
  • HHH-14198 - Expose CompositeUserTypes through JPA Metamodel

    HHH-14198 - Expose CompositeUserTypes through JPA Metamodel

    Composite User Types work like regular Composite Types (like Embeddable) in HQL. However, because they cannot be represented in the JPA metamodel, libraries like GraphQL for JPA or Blaze-Persistence cannot fully utilize them. In order to make the composite property names available to these libraries, it would be nice to optionally expose these attributes as embedded attributes. This pull request aims to make that change and makes it configurable through a custom setting.

    Composite User Types are a common solution for mapping composite interfaces. A common example is for example Money from the Java Money API (JSR-354), for which composite user types are implemented in Jadira.

    I know Composite User Types are currently not consiered in Hibernate 6.x. See also this Zulip thread. I am not sure if Hibernate 6.x will even have multi column types, which I presume would be a requirement to even introduce Composite User types back at some point. Usually Embeddables are a much easier, suitable mechanism for composite user types. But Embeddables are not always a viable alternative, because Embeddables require the type to be subclassed (as an interface cannot be mapped, and the type may not solely comprise fields that can be mapped to a simple basic type). To deal with this exact problem, MonetaryAmounts are still mapped as composite user type. There also have been suggestions to the JPA Spec to consider AttributeConverters for Embeddables for pracitcally the same purpose (which I think is going to be a mess of an implementation). See: https://github.com/eclipse-ee4j/jpa-api/issues/105

    Anyways, regardless of whether this gets integrated in 5.x, I don't expect it to be integrated in 6.x unless we also reintroduce Composite User Types. I am willing to contribute Composite User Types for 6.x if people see benefit in it and think it can be done in the first place.

    https://hibernate.atlassian.net/browse/HHH-14198

    opened by jwgmeligmeyling 24
  • HHH-12454 - Offer flag to consider id generator with local scope (legacy non JPA behavior)

    HHH-12454 - Offer flag to consider id generator with local scope (legacy non JPA behavior)

    https://hibernate.atlassian.net/browse/HHH-12454

    @sebersole any idea for a better name than ID_GENERATOR_NAMES_GLOBAL_SCOPE = "hibernate.id.generator.global_scope_name";?

    Backporting to 5.2 do we have to keep the default value to true?

    Ready for review 
    opened by dreab8 23
  • Use a proxy based Stream decorator to support close on terminal

    Use a proxy based Stream decorator to support close on terminal

    For #4011, here provide a redesign for Stream decorator that supports close on terminal.

    Inspired by https://rmannibucau.metawerx.net/post/java-stream-decorator.

    @NathanQingyangXu @vladmihalcea

    opened by moonfruit 22
  • HHH-15890 Fix shouldEmulateFetchClause method for DB2(i)SqlAstTranslator

    HHH-15890 Fix shouldEmulateFetchClause method for DB2(i)SqlAstTranslator

    https://hibernate.atlassian.net/browse/HHH-15890

    The issue was already solved for DB2400Dialect (deprecated) which uses DB2SqlAstTranslator but not for DB2iDialect / DB2iSqlAstTranslator.

    opened by mbladel 0
  • Bump com.gradle.enterprise from 3.11.1 to 3.12.2

    Bump com.gradle.enterprise from 3.11.1 to 3.12.2

    Bumps com.gradle.enterprise from 3.11.1 to 3.12.2.

    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)
    dependencies 
    opened by dependabot[bot] 1
Releases(5.2.0)
  • 5.2.0(Jun 2, 2016)

    5.2.0 includes many improvements and bug-fixes. For a complete list of changes, see https://hibernate.atlassian.net/projects/HHH/versions/23150/tab/release-report-done.

    Many of the changes in 5.2.0 have important ramifications in terms of both usage and extension. Be sure to read the 5.2 Migration Guide for details.

    Below is a discussion of the major changes.

    Java 8 baseline

    5.2 moves to Java 8 as its baseline. This means:

    • The hibernate-java8 module has been removed, and that functionality has been moved into hibernate-core.
    • Native support for Java 8 date/time types as Query parameters.
    • Support for streaming (java.util.stream.Stream) query results.
    • Support for java.util.Optional as return from methods that may return null.
    • Leveraging Java 8 "default methods" when introducing new methods to extension points.

    Consolidating JPA support into hibernate-core.

    That effectively means that the hibernate-entitymanager module no longer exists. Its functionality being consumed into hibernate-core.

    JCache support

    Support for using any JCache-compliant cache impl as a second-level caching provider.

    Session-level batch size support

    Support has been added for specifying a batch size for write operations per Session.

    Source code(tar.gz)
    Source code(zip)
  • 5.0.5(Dec 3, 2015)

    The 5th bug-fix release for Hibernate ORM 5.0. This release and the upcoming 5.0.6 release have been done on an accelerated time-box of 2 weeks (from the normal 4 weeks for bug-fix releases) due to US holidays.

    The complete list of changes can be found here (or here for people without a Hibernate Jira account).

    For information on consuming the release via your favorite dependency-management-capable build tool, see http://hibernate.org/orm/downloads/

    For those of you allergic to dependency-management-capable build tools, the release bundles can be obtained from SourceForge or BinTray.

    Source code(tar.gz)
    Source code(zip)
  • 5.0.4(Nov 18, 2015)

    The fourth bug-fix release for Hibernate ORM 5.0

    There are 52 issues resolved in this release. 20 of those came out of the recent Jira cleanup. Initially that initiative pulled in roughly 750 issues. To date, 66 of those have been resolved - fixed or verified as out-of-date, unable-to-reproduce, etc. An additional 14 have been more properly reclassified as feature or enhancement requests rather than bugs. The really cool part is the amount of community help we have gotten in making that happen! Thanks to everyone responding, verifying and even fixing alot of these bugs!

    The complete list of changes can be found here. People without a Hibernate Jira account will not be able to access the previous link and can access the changelog in GitHub; the issue I reported with Atlassian has been resolved and is ready for deployment into our hosted environment, I just do not know when that will happen.

    For information on consuming the release via your favorite dependency-management-capable build tool, see http://hibernate.org/orm/downloads/

    For those of you allergic to dependency-management-capable build tools, the release bundles can be obtained from SourceForge or BinTray.

    Source code(tar.gz)
    Source code(zip)
  • 5.0.3(Oct 28, 2015)

    http://in.relation.to/2015/10/28/hibernate-orm-503-final-release/

    Bug

    * [HHH-1400] - formula-based property leads to generation of invalid SQL with subselect fetches
    * [HHH-9074] - HQL Query with boolean and @Convert
    * [HHH-9374] - EntityGraph applied to subquery when using collection function
    * [HHH-9784] - scroll() and iterate() methods do not support provided HQLQueryPlan
    * [HHH-10104] - Using JPA 2.1 schema generation together with hbm2ddl runs into deadlock with MySQL
    * [HHH-10169] - Hibernate ignores foreign-key name in hbm <joined-subclass>
    * [HHH-10170] - Reuse JAXBContext instance (Slow mapping initialization) - port HHH-10065 fix to 5.0 branch
    * [HHH-10172] - Throw MappingException when entity/component class defines multiple matching getters by stem name
    * [HHH-10174] - Incorrect splitting of string using dot as separator
    * [HHH-10180] - hbm2ddl tools cannot generate create/update script not modifying the database
    * [HHH-10188] - "stored" is a reserved keyword in MySQL 5.7
    * [HHH-10189] - NPE in InformationExtractorJdbcDatabaseMetaDataImpl
    * [HHH-10193] - NameQualifierSupport for Hypersonic should be catalog
    * [HHH-10194] - Change NameQualifierSupport for Hypersonic from CATALOG to SCHEMA
    * [HHH-10195] - QueryHintSQLServer2012Test is wrong
    * [HHH-10196] - DefaultGeneratedValueTest fails on MySQL
    * [HHH-10197] - SchemaManagementException when performing SchemaUpdate
    * [HHH-10206] - Primary key not created for a Set after loading from XML mapping file
    * [HHH-10207] - Constraint name not considered for a Set while loading from XML mapping file
    * [HHH-10217] - ModelBinder fails to bind version property when generated="always"
    

    Task

    * [HHH-10137] - Upgrade to/support Jandex 2.0
    * [HHH-10153] - Upgrade to Gradle 2.7
    

    Improvement

    * [HHH-10087] - Support prepending of locks
    * [HHH-10190] - org.hibernate.engine.spi.ActionQueue#executeActions() optimization
    
    Source code(tar.gz)
    Source code(zip)
  • 5.0.2.Final(Sep 30, 2015)

    The complete list of changes can be found here.

    For information on consuming the release into your build via your favorite dependency-management-capable build tool, see http://hibernate.org/orm/downloads/.

    For those of you allergic to dependency-management-capable build tools, the release bundles can be obtained from SourceForge or BinTray.

    Source code(tar.gz)
    Source code(zip)
  • 5.0.1.Final(Sep 3, 2015)

    The complete list of changes can be found here.

    For information on consuming the release into your build via your favorite dependency-management-capable build tool, see http://hibernate.org/orm/downloads/.

    For those of you allergic to dependency-management-capable build tools, the release bundles can be obtained from SourceForge or BinTray.

    Source code(tar.gz)
    Source code(zip)
  • 5.0.0.Final(Aug 20, 2015)

    Today I have released Hibernate ORM 5.0 (5.0.0.Final). This has been a long time coming and is the result of the efforts of many folks. Thanks to everyone who helped us get here with fixes, bug reports, suggestions, input and encouragement!

    A lot of development has gone into 5.0. Here are the big points:

    New bootstrap API

    The venerable way to bootstrap Hibernate (build a SessionFactory) has been to use its Configuration class. Configuration, historically, allowed users to iteratively add settings and mappings in any order and to query the state of settings and mapping information in the middle of that process. Which meant that building the mapping information could not effectively rely on any settings being available. This lead to many limitations and problems.

    5.0 introduces a new bootstrapping API aimed at alleviating those limitations and problems, while allowing better determinism and better integration. See the Bootstrap chapter in the User Guide for details on using the new API.

    Configuration is still available for use, although in a limited sense. Some of its methods have been removed. Under the covers Configuration makes use of the new bootstrap API.

    Spatial/GIS support

    Hibernate Spatial is a project that has been around for a number of years. Karel Maesen has done an amazing job with it.

    Starting in 5.0 Hibernate Spatial is now part of the Hibernate project proper to allow it to better keep up with upstream development. It is available as org.hibernate:hibernate-spatial. If your application has need for GIS data, we highly recommend giving hibernate-spatial a try.

    Java 8 support

    Well, ok.. not all of Java 8. Specifically we have added support for Java 8 Date and Time API in regards to easily mapping attributes in your domain model using the Java 8 Date and Time API types to the database. This support is available under the dedicated hibernate-java8 artifact (to isolate Java 8 dependencies). For additional information, see the Basic Types chapter in the Domain Model Mapping Guide.

    Expanded AUTO id generation support

    JPA defines support for GenerationType#AUTO limited to just Number types. Starting in 5.0 Hibernate offers expandable support for a broader set of types, including built-in support for both Number types (Integer, Long, etc) and UUID. Users are also free to plug in custom strategies for interpreting GenerationType#AUTO via the new org.hibernate.boot.model.IdGeneratorStrategyInterpreter extension.

    Naming strategy split

    NamingStrategy has been removed in favor of a better designed API. 2 distinct ones actually:

    • org.hibernate.boot.model.naming.ImplicitNamingStrategy - used whenever a table or column is not explicitly named to determine the name to use
    • org.hibernate.boot.model.naming.PhysicalNamingStrategy - used to convert a "logical name" (either implicit or explicit) name of a table or column into a physical name (e.g. following corporate naming guidelines)

    Attribute Converter support

    5.0 offers significantly improved support for JPA 2.1 AttributeConverters:

    • fully supported for non-@Enumerated enum values
    • applicable in conjunction with @Nationalized support
    • now called to handle null values
    • settable in hbm.xml by using type="converter:fully.qualified.AttributeConverterName"
    • integrated with hibernate-envers
    • collection values, map keys
    • support for conversion of parameterized types

    Better "bulk id table" support

    Support for "bulk id tables" has been completely redesigned to better fit what different databases support.

    Transaction management

    The transaction SPI underwent a major redesign as part of 5.0 as well. From a user perspective this generally only comes into view in terms of configuration. Previously applications would work with the different backend transaction stratagies directly via the org.hibernate.Transaction API. In 5.0 a level of indirection has been added here. The API implementation of org.hibernate.Transaction is always the same now. On the backend, the org.hibernate.Transaction impl talks to a org.hibernate.resource.transaction.TransactionCoordinator which represents the "transactional context" for a given Session according to the backend transaction strategy. Users generally do not need to care about the distinction.

    The change is noted here because it might affect your bootstrap configuration. Whereas previously applications would specify hibernate.transaction.factory_class and refer to a org.hibernate.engine.transaction.spi.TransactionFactory FQN, with 5.0 the new contract is org.hibernate.resource.transaction.TransactionCoordinatorBuilder and is specified using the hibernate.transaction.coordinator_class setting. See org.hibernate.cfg.AvailableSettings.TRANSACTION_COORDINATOR_STRATEGY JavaDocs for additional details.

    The following short-names are recognized: jdbc::(the default) says to use JDBC-based transactions (org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl) jta::says to use JTA-based transactions (org.hibernate.resource.transaction.backend.jta.internal.JtaTransactionCoordinatorImpl)

    See the User Guide for additional details.

    Schema Tooling

    5.0 offers much improvement in the area of schema tooling (export, validation and migration).

    Typed Session API

    Hibernate's native APIs (Session, etc) have been updated to be typed. No more casting!

    Improved OSGi support

    Really this started with a frustration over the fragility of hibernate-osgi tests. The first piece was a better testing setup using Pax Exam and Karaf. This lead to us generating (and now publishing!) a Hibernate Karaf features file.

    OSGi support has undergone some general improvement as well thanks to feedback from some Karaf and Pax developers and users.

    See the Getting Started Guide for additional details on using the new Karaf features file.

    Improved bytrecode enhancement capabilities

    • dirty tracking
    • bidirectional association management
    • lazy loading

    Work on documentation

    A lot of work has gone into the documentation for 5.0. Its still not complete (is documentation ever "complete"?), but it is much improved.

    See the revamped http://hibernate.org/orm/documentation/5.0[documentation page] for details.

    BinTray

    For now the plan is to publish the release bundles (zip and tgz) to BinTray. We will continue to publish to SourceForge as well. For the time being we will publish the bundles to both.

    Ultimately we will start to publish the "maven" artifacts there as well.

    This is all a work in progress.

    How to get it

    See http://hibernate.atlassian.net/projects/HHH/versions/20851 for the complete list of changes.

    See http://hibernate.org/orm/downloads/ for information on obtaining the releases.

    Source code(tar.gz)
    Source code(zip)
  • 5.0.0.CR4(Aug 5, 2015)

    The fourth candidate release for Hibernate ORM 5.0 (5.0.0.CR4). The purpose was entirely to change the defaults for some settings. This allowed some additional fixes and additional documentation work to make it in.

    Default ImplicitNamingStrategy

    The default ImplicitNamingStrategy (hibernate.implicit_naming_strategy) has changed to the JPA-compliant one. Additionally added some short-names for the Hibernate-provided implementations.

    • "default" -> org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
    • "jpa" -> org.hibernate.boot.model.naming.ImplicitNamingStrategyJpaCompliantImpl
    • "legacy-jpa" -> org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyJpaImpl
    • "legacy-hbm" -> org.hibernate.boot.model.naming.ImplicitNamingStrategyLegacyHbmImpl
    • "component-path" -> org.hibernate.boot.model.naming.ImplicitNamingStrategyComponentPathImpl

    The previous default was "legacy-jpa". Existing applications that previously used the default naming strategy and want to continue to use that implicit naming strategy should specify hibernate.implicit_naming_strategy=legacy-jpa in their configuration settings. Alternatively, they can call MetadataBuilder#setImplicitNamingStrategy(ImplicitNamingStrategyLegacyJpaImpl.INSTANCE).

    Identifier generator mapping

    Back in 3.6 I developed a new set of identifier generator strategies aimed at database portability based on the JPA expectations for @SequenceGenerator and @TableGenerator. Between 3.6 and now the default has been to continue to use the legacy generator strategies, but we added a setting (hibernate.id.new_generator_mappings) to allow applications to request the newer strategies be used. The default for this setting had been false. The default is now true.

    Existing applications updating to CR4 and then Final that experience issues with identifier generator strategy selection should try setting this back to false if they wish to keep using the legacy mappings.

    Keyword auto-quoting

    This is a new feature in 5.0, but previously the default had been to auto-quote any sql identifiers believed to be a keyword in the underlying database. That feature has been disabled by default.

    Applications that wish to use this feature should explicitly enable it by specifying hibernate.auto_quote_keyword=true in their configuration settings.

    More work on the documentation

    Still in progress, but alot more content has been added.

    How to get it

    Additionally many other improvements and bugfixes are included. See https://hibernate.atlassian.net/projects/HHH/versions/20752 for the complete list of changes.

    The release tag is available at https://github.com/hibernate/hibernate-orm/releases/edit/5.0.0.CR4

    As always, see http://hibernate.org/orm/downloads/ for information on obtaining the releases.

    Source code(tar.gz)
    Source code(zip)
  • 5.0.0.CR3(Jul 30, 2015)

    See https://hibernate.atlassian.net/projects/HHH/versions/20350 for the complete change list. The main changes since CR2 include:

    Minor changes to the caching SPI

    Essentially passing Session along to the various region access strategy methods to allow integrating with non-JDBC transactions.

    Work on schema tooling

    Improved namespace (catalog/schema) support overall in schema tools. Improved handling of views and synonyms for migrating and validating.

    Work on bytecode enhancement

    Lots of fixes based on feedback.

    Consistency in Transaction API

    A few changes were made to the JDCB-based TransactionCoordinator to work more like in JTA environments. Specifically:

    • implemented support for marking the Transaction for rollback-only.
    • transaction is now rolled back automatically on a failed commit.

    Work on the documentation

    Besides updating the content, the content has been split into 3 separate guides:

    • User Guide
    • Domain Model Mapping Guide
    • Integrations Guide
    Source code(tar.gz)
    Source code(zip)
  • 5.0.0.CR2(Jul 8, 2015)

    The second candidate release for Hibernate ORM 5.0. CR2 was required because of a bug in how class-loading worked in certain managed JPA environments. The details can be found in tttp://hibernate.atlassian.net/browse/HHH-9887. The main changes since CR1 include:

    Corrected ClassLoader usage

    This is the blocking issue mentioned above. The problem would occur in environments passing a "temp ClassLoader" into Hibernate via the JPA integration SPI (javax.persistence.spi.PersistenceUnitInfo#getNewTempClassLoader) and manifest itself as ClassCastExceptions.

    Second-level caching SPI improvement

    The second-level caching SPI was improved, allowing the caching providers to generate cache keys. This includes the addition of the following methods:

    • org.hibernate.cache.spi.access.EntityRegionAccessStrategy#generateCacheKey
    • org.hibernate.cache.spi.access.CollectionRegionAccessStrategy#generateCacheKey
    • org.hibernate.cache.spi.access.NaturalIdRegionAccessStrategy#generateCacheKey

    Improved cache-by-reference support

    For those making use of caching immutable entities by reference (rather than by "disassembled" state), an additional performance improvement is included in CR2.

    Ability to disable auto-quoting of keyword-as-identifier

    A new feature in 5.0 is the automatic quoting of identifiers that are believed to be keywords in the underlying database. As this support is new, often the Dialects are too aggressive in what they deem to be keywords. Thus we added a new setting to disable this behavior if it causes problems in your application. This can be controlled by specifying hibernate.auto_quote_keyword as false in configuration settings.

    Significantly improved bytecode enhancement support

    Including:

    • added ability for automatic management of bi-directional associations
    • self-contained dirty state tracking (more efficient flushing), including switchable algorithms for dirty determination

    Odds-n-ends

    Additionally many other improvements and bugfixes are included. See https://hibernate.atlassian.net/projects/HHH/versions/20150 for the complete list of changes.

    The release tag is available at https://github.com/hibernate/hibernate-orm/releases/tag/5.0.0.CR2

    As always, see http://hibernate.org/orm/downloads/ for information on obtaining the releases.

    Source code(tar.gz)
    Source code(zip)
  • 5.0.0.CR1(May 28, 2015)

    The Hibernate team is proud to announce the first candidate release for 5.0. The main changes since the Beta2 release include:

    • Initial generic typing for Hibernate native (Session, e.g.) APIs
    • Continued development of the new bytecode enhancement capabilities including improved support in the Maven and Gradle plugins
    • Support for parameterized types with AttributeConverter implementations
    • Improved OSGi integration testing using Pax Exam and Karaf, and publishing a hibernate-osgi Karaf features file
    • Auto quoting of keywords used as identifiers (User, e.g.).
    • Incorporating fixes, improvements and suggestions to the improved schema update and validation tooling

    A lot of help from the community went into this release and the previous Beta releases. Thanks for all the help and work and testing and doggedness!

    As always, see http://hibernate.org/orm/downloads/ for information on obtaining the releases.

    Report any issues to Hibernate Jira

    Source code(tar.gz)
    Source code(zip)
  • 4.3.1.Final(Jan 22, 2014)

    See the details at http://in.relation.to/Bloggers/HibernateORM431FinalRelease. See http://hibernate.org/orm/downloads/ for information on getting the artifacts.

    Source code(tar.gz)
    Source code(zip)
  • 4.3.0.Beta5(Oct 9, 2013)

  • 4.3.0.Beta4(Oct 9, 2013)

  • 4.2.4.Final(Aug 8, 2013)

    Hibernate ORM 4.2.4.Final was just released, containing multiple bug fixes. Please see the full changelog for more information: https://hibernate.atlassian.net/secure/ReleaseNote.jspa?projectId=10031&version=13750

    JBoss Nexus: https://repository.jboss.org/nexus/content/groups/public/org/hibernate Maven Central: http://repo1.maven.org/maven2/org/hibernate/hibernate-core (should update in a couple of days) SourceForge: https://sourceforge.net/projects/hibernate/files/hibernate4 Downloads: binaries attached

    Source code(tar.gz)
    Source code(zip)
    hibernate-release-4.2.4.Final.tgz(46.35 MB)
    hibernate-release-4.2.4.Final.zip(70.87 MB)
  • 4.2.3.Final(Jul 3, 2013)

    Hibernate ORM 4.2.3.Final was just released. The full changelog can be viewed here

    HHH-8112 fully documented the OSGi capabilities and included multiple quickstart projects. Please see the Dev Guide and Quickstart.

    This release also completed the umbrella OSGi task: HHH-7527! Finally -- whew!

    Multiple minor bug fixes were included -- please see the changelog for more info.

    JBoss Nexus: https://repository.jboss.org/nexus/content/groups/public/org/hibernate Maven Central: http://repo1.maven.org/maven2/org/hibernate/hibernate-core SourceForge: https://sourceforge.net/projects/hibernate/files/hibernate4 Downloads: (binaries attached)

    Source code(tar.gz)
    Source code(zip)
    hibernate-release-4.2.3.final.tgz(41.00 MB)
    hibernate-release-4.2.3.final.zip(64.46 MB)
Fast and Easy mapping from database and csv to POJO. A java micro ORM, lightweight alternative to iBatis and Hibernate. Fast Csv Parser and Csv Mapper

Simple Flat Mapper Release Notes Getting Started Docs Building it The build is using Maven. git clone https://github.com/arnaudroger/SimpleFlatMapper.

Arnaud Roger 418 Dec 17, 2022
Mars - Object Relational Mapping Framework for MongoDB (MongoDB ORM)

Mars Object Relational Mapping Framework for MongoDB 致自己 造自己的轮子,让别人去说 ; What is Mars Mars is a unified driver platform product developed by Shanghai J

null 35 Nov 17, 2022
Reladomo is an enterprise grade object-relational mapping framework for Java.

Reladomo What is it? Reladomo is an object-relational mapping (ORM) framework for Java with the following enterprise features: Strongly typed compile-

Goldman Sachs 360 Nov 2, 2022
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 shoul

Gray 547 Dec 25, 2022
dOOv (Domain Object Oriented Validation) a fluent API for type-safe bean validation and mapping

dOOv (Domain Object Oriented Validation) dOOv is a fluent API for typesafe domain model validation and mapping. It uses annotations, code generation a

dOOv 77 Nov 20, 2022
Intelligent object mapping

ModelMapper ModelMapper is an intelligent object mapping library that automatically maps objects to each other. It uses a convention based approach wh

ModelMapper 2.1k Dec 28, 2022
A declarative mapping library to simplify testable object mappings.

ReMap - A declarative object mapper Table of Contents Long story short About ReMap Great News Mapping operations Validation Features Limitations The m

REMONDIS IT Services GmbH & Co. KG 103 Dec 27, 2022
Netflix, Inc. 809 Dec 28, 2022
HasorDB is a Full-featured database access tool, Providing object mapping,Richer type handling than Mybatis, Dynamic SQL

HasorDB is a Full-featured database access tool, Providing object mapping,Richer type handling than Mybatis, Dynamic SQL, stored procedures, more dialect 20+, nested transactions, multiple data sources, conditional constructors, INSERT strategies, multiple statements/multiple results. And compatible with Spring and MyBatis usage.

赵永春 17 Oct 27, 2022
An object mapping jetbrains plugin, it will automatically generate the get/set code between the two objects.

BeanMappingKey 简体中文 | English 一键生成两个实体类之间的字段映射代码,用于代替 BeanUtil 与 MapStruct 等工具。 使用指南 在 Java 开发的过程中,经常会使用众多包装型的对象如:BO、VO、DTO,它们之间往往只有两三个字段的差异, 而对它们进行相互

Rookie 60 Dec 14, 2022
dOOv (Domain Object Oriented Validation) a fluent API for type-safe bean validation and mapping

dOOv (Domain Object Oriented Validation) dOOv is a fluent API for typesafe domain model validation and mapping. It uses annotations, code generation a

dOOv 77 Nov 20, 2022
Tuya 37 Dec 26, 2022
Mystral (pronounced "Mistral") is an efficient library to deal with relational databases quickly.

Mystral An efficient library to deal with relational databases quickly. A little request: read the Javadoc to understand how these elements work in de

null 13 Jan 4, 2023
Allows you to use the MongoDB query syntax to query your relational database.

Spring Data JPA MongoDB Expressions How it works: Customize JPA Repository base class: @SpringBootApplication @EnableJpaRepositories(repositoryBaseCla

Muhammad Hewedy 86 Dec 27, 2022
Database Subsetting and Relational Data Browsing Tool.

Jailer Database Tool Jailer is a tool for database subsetting and relational data browsing. The Subsetter exports consistent, referentially intact row

Wisser 1.5k Jan 7, 2023
Relational database project, PC Builder, for the Database Systems Design course.

README: Starting the Progam: This program was built and ran on the Eclipse IDE. To run, first create the database, "ty_daniel_db", using the ty_dani

Daniel Ty 1 Jan 6, 2022
Text Object Java Objects (TOJOs): an object representation of a multi-line structured text file like CSV

It's a simple manager of "records" in a text file of CSV, JSON, etc. format. It's something you would use when you don't want to run a full database,

Yegor Bugayenko 19 Dec 27, 2022
Backport of functionality based on JSR-310 to Java SE 6 and 7. This is NOT an implementation of JSR-310.

ThreeTen backport project JSR-310 provides a new date and time library for Java SE 8. This project is the backport to Java SE 6 and 7. See the main ho

ThreeTen 541 Jan 8, 2023