{"id":13494820,"url":"https://github.com/hibernate/hibernate-orm","last_synced_at":"2026-04-01T22:31:14.505Z","repository":{"id":1099718,"uuid":"961036","full_name":"hibernate/hibernate-orm","owner":"hibernate","description":"Hibernate's core Object/Relational Mapping functionality","archived":false,"fork":false,"pushed_at":"2025-05-12T15:47:08.000Z","size":287494,"stargazers_count":6147,"open_issues_count":137,"forks_count":3624,"subscribers_count":302,"default_branch":"main","last_synced_at":"2025-05-12T18:15:28.231Z","etag":null,"topics":["database","envers","hibernate","hibernate-orm","jakarta-persistence","jakartaee","java","jdbc","jpa","object-relational-mapper","object-relational-mapping","orm","persistence","persistence-framework","sql"],"latest_commit_sha":null,"homepage":"http://hibernate.org","language":"Java","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hibernate.png","metadata":{"files":{"readme":"README.adoc","changelog":"changelog.txt","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2010-10-04T16:15:52.000Z","updated_at":"2025-05-12T15:47:12.000Z","dependencies_parsed_at":"2025-05-05T15:58:26.111Z","dependency_job_id":null,"html_url":"https://github.com/hibernate/hibernate-orm","commit_stats":{"total_commits":17049,"total_committers":696,"mean_commits":"24.495689655172413","dds":0.7951199483840694,"last_synced_commit":"e8f2f79236f5b05db449f49eab0d526b19df9ccd"},"previous_names":[],"tags_count":381,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hibernate%2Fhibernate-orm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hibernate%2Fhibernate-orm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hibernate%2Fhibernate-orm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hibernate%2Fhibernate-orm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hibernate","download_url":"https://codeload.github.com/hibernate/hibernate-orm/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253795161,"owners_count":21965487,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","envers","hibernate","hibernate-orm","jakarta-persistence","jakartaee","java","jdbc","jpa","object-relational-mapper","object-relational-mapping","orm","persistence","persistence-framework","sql"],"created_at":"2024-07-31T19:01:28.564Z","updated_at":"2026-01-04T02:16:45.077Z","avatar_url":"https://github.com/hibernate.png","language":"Java","readme":"== Hibernate ORM\n\nimage:https://img.shields.io/maven-central/v/org.hibernate.orm/hibernate-core.svg?label=Maven%20Central\u0026style=for-the-badge[Maven Central,link=https://central.sonatype.com/search?namespace=org.hibernate.orm\u0026sort=name]\nimage:https://img.shields.io/jenkins/build?jobUrl=https%3A%2F%2Fci.hibernate.org%2Fjob%2Fhibernate-orm-pipeline%2Fjob%2Fmain%2F\u0026style=for-the-badge[Build Status,link=https://ci.hibernate.org/job/hibernate-orm-pipeline/job/main/]\nimage:https://img.shields.io/badge/Revved%20up%20by-Develocity-06A0CE?style=for-the-badge\u0026logo=gradle[Develocity,link=https://develocity.commonhaus.dev/scans?search.rootProjectNames=Hibernate%20ORM]\nimage:https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/jvm-repo-rebuild/reproducible-central/master/content/org/hibernate/orm/hibernate-core/badge.json\u0026style=for-the-badge[Reproducible Builds,link=https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/hibernate/orm/hibernate-core/README.md]\nimage:https://testpilot.oracle.com/ords/testpilot/badges/github/hibernate/hibernate-orm[Oracle Test Pilot,link=https://testpilot.oracle.com/]\n\nHibernate ORM is a powerful object/relational mapping solution for Java, and makes it easy to develop persistence logic for applications, libraries, and frameworks.\n\nHibernate implements JPA, the standard API for object/relational persistence in Java, but also offers an extensive set of features and APIs which go beyond the specification.\n\nSee https://hibernate.org/orm/[Hibernate.org] for more information.\n\n== Continuous Integration\n\nSee link:MAINTAINERS.md#ci[MAINTAINERS.md] for information about CI.\n\n== Building from sources\n\nThe build requires at least JDK 25, and produces Java 17 bytecode.\n\nHibernate uses https://gradle.org[Gradle] as its build tool. See the _Gradle Primer_ section below if you are new to\nGradle.\n\nContributors should read the link:CONTRIBUTING.md[Contributing Guide].\n\nSee the guides for setting up https://hibernate.org/community/contribute/intellij-idea/[IntelliJ] or\nhttps://hibernate.org/community/contribute/eclipse-ide/[Eclipse] as your development environment.\n\n== Gradle Primer\n\nThe Gradle build tool has amazing documentation.  2 in particular that are indispensable:\n\n* https://docs.gradle.org/current/userguide/userguide_single.html[Gradle User Guide] is a typical user guide in that\nit follows a topical approach to describing all of the capabilities of Gradle.\n* https://docs.gradle.org/current/dsl/index.html[Gradle DSL Guide] is unique and excellent in quickly\ngetting up to speed on certain aspects of Gradle.\n\nWe will cover the basics developers and contributors new to Gradle need to know to get productive quickly.\n\nNOTE: The project defines a https://docs.gradle.org/current/userguide/gradle_wrapper.html[Gradle Wrapper].\nThe rest of the section will assume execution through the wrapper.\n\n=== Executing Tasks\n\nGradle uses the concept of build tasks (equivalent to Ant targets or Maven phases/goals). You can get a list of\navailable tasks via \n\n----\ngradle tasks\n----\n\nTo execute a task across all modules, simply perform that task from the root directory. Gradle will visit each\nsub-project and execute that task if the sub-project defines it. To execute a task in a specific module you can\neither:\n\n. `cd` into that module directory and execute the task\n. name the \"task path\". For example, to run the tests for the _hibernate-core_ module from the root directory\nyou could say `gradle hibernate-core:test`\n\n=== Common tasks\n\nThe common tasks you might use in building Hibernate include:\n\n* _build_ - Assembles (jars) and tests this project\n* _compile_ - Performs all compilation tasks including staging resources from both main and test\n* _jar_ - Generates a jar archive with all the compiled classes\n* _test_ - Runs the tests\n* _publishToMavenLocal_ - Installs the project jar to your local maven cache (aka ~/.m2/repository). Note that Gradle\nnever uses this, but it can be useful for testing your build with other local Maven-based builds.\n* _clean_ - Cleans the build directory\n\n== Testing and databases\n\nTesting against a specific database can be achieved in 2 different ways:\n\n=== Using the \"Matrix Testing Plugin\" for Gradle.\n\nComing later…\n\n=== Using \"profiles\"\n\nThe Hibernate build defines several database testing \"profiles\" in `databases.gradle`. These\nprofiles can be activated by name using the `db` build property which can be passed either as\na JVM system prop (`-D`) or as a Gradle project property (`-P`). Examples below use the Gradle\nproject property approach.\n\n----\ngradle clean build -Pdb=pgsql\n----\n\nTo run a test from your IDE, you need to ensure the property expansions happen.\nUse the following command:\n\n----\ngradle clean compile -Pdb=pgsql\n----\n\n__NOTE: If you are running tests against a JDBC driver that is not available via Maven central be sure to\nadd these drivers to your local Maven repo cache (~/.m2/repository) or (better) add it to a personal Maven repo server__\n\n=== Running database-specific tests from the IDE using \"profiles\"\n\nYou can run any test on any particular database that is configured in a `databases.gradle` profile.\n\nAll you have to do is run the following command:\n\n----\n./gradlew setDataBase -Pdb=pgsql\n----\n\nor you can use the shortcut version: \n\n----\n./gradlew sDB -Pdb=pgsql\n----\n\nYou can do this from the module which you are interested in testing or from the `hibernate-orm` root folder.\n\nAfterward, just pick any test from the IDE and run it as usual. Hibernate will pick the database configuration from the `hibernate.properties`\nfile that was set up by the `setDataBase` Gradle task.\n\n=== Starting test databases locally as docker containers\n\nYou don't have to install all databases locally to be able to test against them in case you have docker available.\nThe script `docker_db.sh` allows you to start a pre-configured database which can be used for testing.\n\nAll you have to do is run the following command:\n\n----\n./docker_db.sh postgresql\n----\n\nomitting the argument will print a list of possible options.\n\nWhen the database is properly started, you can run tests with special profiles that are suffixed with `_ci`\ne.g. `pgsql_ci` for PostgreSQL. By using the system property `dbHost` you can configure the IP address of your docker host.\n\nThe command for running tests could look like the following:\n\n----\n./gradlew test -Pdb=pgsql_ci \"-DdbHost=192.168.99.100\"\n----\n\nThe following table illustrates a list of commands for various databases that can be tested locally.\n\n|===\n|Database |`docker_db.sh` |Gradle command\n\n|H2\n|-\n|`./gradlew test -Pdb=h2`\n\n|HSQLDB\n|-\n|`./gradlew test -Pdb=hsqldb`\n\n|Apache Derby\n|-\n|`./gradlew test -Pdb=derby`\n\n|MySQL\n|`./docker_db.sh mysql`\n|`./gradlew test -Pdb=mysql_ci`\n\n|MariaDB\n|`./docker_db.sh mariadb`\n|`./gradlew test -Pdb=mariadb_ci`\n\n|PostgreSQL\n|`./docker_db.sh postgresql`\n|`./gradlew test -Pdb=pgsql_ci`\n\n|EnterpriseDB\n|`./docker_db.sh edb`\n|`./gradlew test -Pdb=edb_ci`\n\n|Oracle\n|`./docker_db.sh oracle`\n|`./gradlew test -Pdb=oracle_ci`\n\n|DB2\n|`./docker_db.sh db2`\n|`./gradlew test -Pdb=db2_ci`\n\n|SQL Server\n|`./docker_db.sh mssql`\n|`./gradlew test -Pdb=mssql_ci`\n\n|Sybase ASE (jTDS)\n|`./docker_db.sh sybase`\n|`./gradlew test -Pdb=sybase_ci`\n\n|Sybase ASE (jConnect)\n|`./docker_db.sh sybase`\n|`./gradlew test -Pdb=sybase_jconn_ci`\n\n|SAP HANA\n|`./docker_db.sh hana`\n|`./gradlew test -Pdb=hana_ci`\n\n|CockroachDB\n|`./docker_db.sh cockroachdb`\n|`./gradlew test -Pdb=cockroachdb`\n\n|TiDB\n|`./docker_db.sh tidb`\n|`./gradlew test -Pdb=tidb`\n\n|Informix\n|`./docker_db.sh informix`\n|`./gradlew test -Pdb=informix`\n|===\n\nTo stop a container started by `docker`, use the command\n\n[source]\n----\ndocker stop $container_name\n----\n\nNOTE:: Substitute `podman` command for `docker` if using `podman`\n\nE.g., to stop the mariadb container\n\n[source]\n----\ndocker stop mariadb\n----\n","funding_links":[],"categories":["Java","数据库开发","II. Databases, search engines, big data and machine learning"],"sub_categories":["5. ORM"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhibernate%2Fhibernate-orm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhibernate%2Fhibernate-orm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhibernate%2Fhibernate-orm/lists"}