Skip to content

Commit 100904b

Browse files
stIncMalevbabanin
andauthored
Improve README.md, fix LICENSE (#143)
--------- Co-authored-by: Viacheslav Babanin <frest0512@gmail.com>
1 parent be22e67 commit 100904b

File tree

2 files changed

+91
-39
lines changed

2 files changed

+91
-39
lines changed

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright [yyyy] [name of copyright owner]
189+
Copyright 2024-present MongoDB, Inc.
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 90 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,128 @@
11
# MongoDB Extension for Hibernate ORM
22

3-
This product enables applications to use databases managed by the [MongoDB](https://www.mongodb.com/) DBMS
4-
via [Hibernate ORM](https://hibernate.org/orm/).
3+
<p align="right">
4+
<a href="https://docs.oracle.com/en/java/javase/17/">
5+
<img src="https://img.shields.io/badge/Java_SE-17+-E49639.svg?labelColor=32728B"
6+
alt="Java SE requirement">
7+
</a>
8+
<a href="https://hibernate.org/orm/documentation/6.6/">
9+
<img src="https://img.shields.io/badge/Hibernate_ORM-6.6-BAAE80.svg?labelColor=5C656C"
10+
alt="Hibernate ORM requirement">
11+
</a>
12+
<a href="https://www.mongodb.com/docs/manual/">
13+
<img src="https://img.shields.io/badge/MongoDB_-7.0+-00ED64.svg?labelColor=001E2B"
14+
alt="MongoDB DBMS requirement">
15+
</a>
16+
</p>
517

618
## Overview
719

8-
MongoDB speaks MQL (**M**ongoDB **Q**uery **L**anguage) instead of SQL. This product works by:
20+
This product enables applications to use databases managed by the [MongoDB](https://www.mongodb.com/) DBMS
21+
via [Hibernate ORM](https://hibernate.org/orm/).
22+
23+
MongoDB speaks [MQL (**M**ongoDB **Q**uery **L**anguage)](https://www.mongodb.com/docs/manual/reference/mql/)
24+
instead of SQL. This product works by:
925

1026
- Creating a JDBC adapter using [MongoDB Java Driver](https://www.mongodb.com/docs/drivers/java-drivers/),
11-
which has to be plugged into Hibernate ORM via a custom [`ConnectionProvider`](https://docs.jboss.org/hibernate/orm/6.6/javadocs/org/hibernate/engine/jdbc/connections/spi/ConnectionProvider.html).
12-
- Translating Hibernate's internal SQL AST into MQL by means of a custom [`Dialect`](https://docs.jboss.org/hibernate/orm/6.6/javadocs/org/hibernate/dialect/Dialect.html),
27+
which has to be plugged into Hibernate ORM via a custom
28+
[`ConnectionProvider`](https://docs.jboss.org/hibernate/orm/6.6/javadocs/org/hibernate/engine/jdbc/connections/spi/ConnectionProvider.html).
29+
- Translating Hibernate's internal SQL AST into MQL by means of a custom
30+
[`Dialect`](https://docs.jboss.org/hibernate/orm/6.6/javadocs/org/hibernate/dialect/Dialect.html),
1331
which has to be plugged into Hibernate ORM.
1432

15-
## Development
33+
## User Documentation
1634

17-
Java 17 is the JDK version for development.
35+
- [Manual](https://www.mongodb.com/docs/languages/java/mongodb-hibernate/current)
36+
- [API](https://javadoc.io/doc/org.mongodb/mongodb-hibernate/latest/index.html)
1837

19-
Initially Hibernate ORM v6.6 is the dependency version.
38+
[Standalone deployments](https://www.mongodb.com/docs/manual/reference/glossary/#std-term-standalone) are not supported,
39+
because they [do not support transactions](https://www.mongodb.com/docs/manual/core/transactions-production-consideration/).
40+
If you use one, you may [convert it to a replica set](https://www.mongodb.com/docs/manual/tutorial/convert-standalone-to-replica-set/).
2041

21-
MongoDB v7.0 is the minimal version this product supports.
42+
### Maven Artifacts
2243

23-
> [Standalone instance](https://www.mongodb.com/docs/manual/reference/glossary/#std-term-standalone) is not supported. It is recommended to [convert it to a replica set](https://www.mongodb.com/docs/manual/tutorial/convert-standalone-to-replica-set/).
44+
The `groupId:artifactId` coordinates: `org.mongodb:mongodb-hibernate`.
2445

25-
### Build from Source
46+
- [Maven Central Repository](https://repo.maven.apache.org/maven2/org/mongodb/mongodb-hibernate/)
47+
- [Maven Central Repository Search](https://central.sonatype.com/artifact/org.mongodb/mongodb-hibernate)
48+
49+
### Bug Reports
2650

27-
#### Static Code Analysis
51+
Use ["Extension for Hibernate ORM" at jira.mongodb.org](https://jira.mongodb.org/projects/HIBERNATE/issues).
2852

29-
#### Code Style Check
53+
### Feature Requests
3054

31-
We chose [Spotless](https://github.com/diffplug/spotless/tree/main/plugin-gradle) as a general-purpose formatting plugin, and [Palantir Java Format](https://github.com/palantir/palantir-java-format) as a Java-specific formatting tool integrated with it.
55+
Use ["Drivers & Frameworks"/"Frameworks (e.g. Django, Hibernate, EFCore)" at feedback.mongodb.com" at feedback.mongodb.com](https://feedback.mongodb.com/?category=7548141831345841376).
3256

33-
To check whether any format violation exists, run `spotlessCheck` gradle task. If any format violation is found during the previous step, run `spotlessApply` auto-formatting task to fix it automatically.
57+
## Contributor Documentation
3458

35-
#### Code Quality Check
59+
[Gradle](https://gradle.org/) is used as a build tool.
3660

37-
[Error Prone](https://github.com/tbroyer/gradle-errorprone-plugin) gradle plugin is chosen for Java code qualify analysis during Java compiling phrase. [NullAway](https://github.com/uber/NullAway) is a Java `NullPointerException`s (NPEs) prevention gradle plugin integrated with Error Prone. [JSpecify](https://jspecify.dev) annotations are used to help NullAway detect potential NPEs.
61+
### Build from Source
3862

39-
Both plugins are enabled on gradle's `compileJava` task.
63+
```console
64+
./gradlew clean build
65+
```
4066

41-
### Testing
67+
### Static Code Analysis
4268

43-
This project uses separate directories for unit and integration tests:
69+
#### Code Formatting
4470

45-
- [unit test](src/test)
46-
- [integration test](src/integrationTest)
71+
[Spotless](https://github.com/diffplug/spotless)
72+
[Gradle plugin](https://github.com/diffplug/spotless/tree/main/plugin-gradle) is used as a general-purpose formatting tool,
73+
[Palantir Java Format](https://github.com/palantir/palantir-java-format) is used as a Java-specific formatting tool
74+
integrated with it.
4775

48-
#### Gradle Tasks
76+
##### Check Code Formatting
4977

50-
##### Unit Test
5178
```console
52-
./gradlew clean test
79+
./gradlew spotlessCheck
5380
```
5481

55-
##### Integration Test
82+
##### Format Code
83+
5684
```console
57-
./gradlew clean integrationTest
85+
./gradlew spotlessApply
5886
```
5987

60-
Integration tests require a MongoDB deployment with test commands enabled,
61-
which may be achieved with the
88+
#### Code Quality
89+
90+
[Error Prone](https://errorprone.info/) [Gradle plugin](https://github.com/tbroyer/gradle-errorprone-plugin)
91+
is used as a Java-specific code analysis tool,
92+
[NullAway](https://github.com/uber/NullAway) is used as a
93+
[`NullPointerException`](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/NullPointerException.html)
94+
prevention tool integrated with it. [JSpecify](https://jspecify.dev) annotations are used to specify nullness.
95+
96+
The analysis is done as part of the Gradle `compileJava` task execution.
97+
98+
### Testing
99+
100+
This project uses separate directories for unit and integration tests:
101+
102+
- [`./src/test`](src/test)
103+
- [`./src/integrationTest`](src/integrationTest)
104+
105+
Integration tests require a MongoDB deployment with test commands enabled, which may be achieved with the
62106
[`--setParameter enableTestCommands=1`](https://www.mongodb.com/docs/manual/reference/parameters/)
63107
command-line arguments.
64-
You may change the default [MongoDB connection string](https://www.mongodb.com/docs/manual/reference/connection-string/) as below, in [hibernate.properties](src/integrationTest/resources/hibernate.properties):
65108

66-
```properties
67-
jakarta.persistence.jdbc.url={your_mongodb_connection_string}
109+
You may change the [MongoDB connection string](https://www.mongodb.com/docs/manual/reference/connection-string/)
110+
via the [`jakarta.persistence.jdbc.url`](https://docs.hibernate.org/orm/6.6/userguide/html_single/#settings-jakarta.persistence.jdbc.url)
111+
configuration property
112+
in [`./src/integrationTest/resources/hibernate.properties`](src/integrationTest/resources/hibernate.properties).
113+
114+
#### Run Unit Tests
115+
116+
```console
117+
./gradlew test
68118
```
69119

70-
### CI/CD
71-
This project uses [evergreen](https://github.com/evergreen-ci/evergreen), a distributed continuous integration system from MongoDB. The evergreen configuration is in the [.evergreen](/.evergreen) directory.
120+
#### Run Integration Tests
121+
122+
```console
123+
./gradlew integrationTest
124+
```
72125

73-
## References
74-
- [An Introduction to Hibernate 6](https://docs.jboss.org/hibernate/orm/6.6/introduction/html_single/Hibernate_Introduction.html)
75-
- [A Guide to Hibernate Query Language](https://docs.jboss.org/hibernate/orm/6.6/querylanguage/html_single/Hibernate_Query_Language.html)
76-
- [Hibernate User Guide](https://docs.jboss.org/hibernate/orm/6.6/userguide/html_single/Hibernate_User_Guide.html)
126+
### Continuous Integration
127+
[Evergreen](https://github.com/evergreen-ci/evergreen) and [GitHub actions](https://docs.github.com/en/actions)
128+
are used for continuous integration.

0 commit comments

Comments
 (0)