Movatterモバイル変換


[0]ホーム

URL:


ORM
AboutReleasesDocumentationQuicklyMigration guidesBooksProcessorToolingEnversContributePaid support
Source codeIssue trackerSecurity issueForumCIRoadmap
Search
AboutReleasesDocumentationMigration guidesMore resourcesRoadmapContributeToolingPaid supportFAQ
Source codeIssue trackerSecurity issueForumWikiCI
Validator
AboutReleasesDocumentationMigration guidesRoadmapContributeToolingPaid supportFAQ
Source codeIssue trackerSecurity issueForumCI
Reactive
AboutReleasesDocumentationContributePaid support
Source codeIssue trackerSecurity issueForumCI
Repositories
AboutReleasesDocumentationQuickly
Source codeIssue trackerSecurity issue
Others
Community
CommunityGovernanceCommonhaus - MembershipCommonhaus - Joining FAQContribute - GuidelinesContribute - Set up IntelliJ IDEAContribute - Set up Eclipse IDEContribute - Build Hibernate ORMTeamContributors to ORMContributors to SearchContributors to ValidatorContributors to ReactiveContributors to ToolsContributors to OGMCorporate contributorsCompatibility policyMaintenance policyLicensesKeys
BlogForumsFollow us
HibernateMenu
Hibernate
ORMSearchValidatorReactiveRepositoriesOthers
BlogForumsCommunityFollow us

Community

Setting up Eclipse to contribute to Hibernate projects

CommunityGovernanceTeamCorporate contributorsCompatibility policyMaintenance policyLicensesKeys

Build system integration

Identifying the build system

Some of the Hibernate projects use Maven, some others use Gradle.After you check out the project fromGitHub,check if there is apom.xml file in the root of the sources: that means it’s a Maven project.If there is abuild.gradle file instead, then you will need to use Gradle to build it.

Maven

We recommend using the excellent m2e plugin.This plugin is commonly already installed in Eclipse;if you suspect it’s missing you should be able to find it under "Help" → "Install New Software".

When importing a Hibernate project using m2e, Eclipse might suggest to install additional plugins,for example to handle annotation processors.It will ask for permission to automatically download the additional plugins;we suggest to allow this as it simplifies development.

Gradle

You will need to install "Buildship", the Gradle tools for Eclipse.

Installing it is very simple: just followthis step by step tutorial.

After having installed the Gradle tooling, import the project using the "gradle wrapper" approach — which is the default.This might take several minutes, as the Gradle build might need to download dependencies in the background,or do some work to analyze the project.

Specific instructions for Hibernate ORM in Eclipse

If you’re importing the flagship project Hibernate ORM,the import process gets a bit more tedious as the Eclipse/Gradle integration is still a bit limited.

After importing the project, you will have Eclipse mention several errors because of "circular dependency problems".The project actually doesn’t have any circular dependency but the Gradle integration leads it to believe this;you will have to go in "Window" → "Preferences" → "Java" → "Compiler" → "Building",find the "Circular Dependencies" problem and have Eclipse ignore the problemby categorizing it as "Warning" rather than "Error".

Next, for several modules you will have to manually add some generated sources to the source folders.For example for the hibernate-core module, you will need to addtarget/generated-src/antlr/main,target/generated-src/apt/main,target/generated-src/apt/test andtarget/generated-src/jaxb/main.Note that these directories might be hidden by default,check your Filter options and uncheck "Gradle build folder".Use "Build Path" → "Use as Source Folder" on each of these.

Finally, you will have to manually add the ANT and JBoss Logger dependencies.

Code formatting

From the Eclipse menu: "Window" → "Preferences", select "Java" → "Code Style" → "Formatter".Downloadhibernate-java-formatting.xmlfrom GitHuband import it into Eclipse to apply the style the Hibernate team uses consistently across the codebase.

Please avoid re-formatting large sections of code, especially when providing a patch:we would love to have the diffs highlight the changes which matter.

If you feel the need to fix formatting on an existing source file,make sure to isolate your formatting fixes in a separate committhat contains exclusively formatting changes (avoid any functional change in that commit)and make sure the commit message mentions this.

Code templates

In the same "Window" → "Preferences" menu, select "Java" → "Code Style" → "Code Templates"and import the appropriate file downloaded from our GitHub repository:

With these templates, newly created files will automatically have the proper copyright/license headers.Feel free to add your nick or full name as author of new files, and optionally provide an email.The copyright/license header is a requirement.

You can also use thehibernate-auto-cleanup.xml,to be imported into "Java" → "Code Style" → "Clean Up".

Running tests in Eclipse

Some tests involving integration with JGroups and/or Infinispan will start a network connection to themselves(via localhost) to simulate a cluster of computers.Many JVMs default to IPv6 for this, so either you have that configured correctlyor you might want to start these tests with these JVM properties set:

-Djava.net.preferIPv4Stack=true -Djgroups.bind_addr=127.0.0.1

Debugging

When debugging, Eclipse might invoketoString() methods on the objects you select for inspection.This operation could trigger initialization of proxies and so affect the debugged object state.Using Eclipse you can customize the way it shows objects: look into "Detail formatters"and theIntelliJ IDEA page for some ideas.You could avoid including lazy-loaded details in yourtoString() implementations:it also helps to avoid unintended loading during logging, a frequent mistake having terrible effects on performance.

Beyond

If you want to contribute to Hibernate projects, starthere.

Projects

Follow us

Contribute and community

Back to top

[8]ページ先頭

©2009-2025 Movatter.jp