-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from Thadoy/feature/remove_legacy_mongo
Feature/remove legacy mongo
- Loading branch information
Showing
92 changed files
with
3,882 additions
and
670 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> | ||
<module version="4"> | ||
<component name="AdditionalModuleElements"> | ||
<content url="file://$MODULE_DIR$" dumb="true"> | ||
<excludeFolder url="file://$MODULE_DIR$/target" /> | ||
</content> | ||
</component> | ||
<component name="SonarLintModuleSettings"> | ||
<option name="uniqueId" value="1550f39e-5211-42d0-9707-106a048f7047" /> | ||
</component> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> | ||
<module version="4"> | ||
<component name="AdditionalModuleElements"> | ||
<content url="file://$MODULE_DIR$" dumb="true"> | ||
<excludeFolder url="file://$MODULE_DIR$/target" /> | ||
</content> | ||
</component> | ||
<component name="SonarLintModuleSettings"> | ||
<option name="uniqueId" value="c2d793f0-e542-44fd-b34d-ce8438d9fa47" /> | ||
</component> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> | ||
<module version="4"> | ||
<component name="AdditionalModuleElements"> | ||
<content url="file://$MODULE_DIR$" dumb="true"> | ||
<excludeFolder url="file://$MODULE_DIR$/target" /> | ||
</content> | ||
</component> | ||
<component name="SonarLintModuleSettings"> | ||
<option name="uniqueId" value="a28444bb-5298-4d52-9e90-5be68fc2d236" /> | ||
</component> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" version="4"> | ||
<module version="4"> | ||
<component name="AdditionalModuleElements"> | ||
<content url="file://$MODULE_DIR$" dumb="true"> | ||
<excludeFolder url="file://$MODULE_DIR$/target" /> | ||
</content> | ||
</component> | ||
<component name="RModuleSettingsStorage"> | ||
<LOAD_PATH number="0" /> | ||
<I18N_FOLDERS number="1" string0="$MODULE_DIR$/i18n" /> | ||
</component> | ||
<component name="SonarLintModuleSettings"> | ||
<option name="uniqueId" value="7c2c9c50-04a2-465d-baeb-9fd85282da67" /> | ||
</component> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> | ||
<module version="4"> | ||
<component name="AdditionalModuleElements"> | ||
<content url="file://$MODULE_DIR$" dumb="true"> | ||
<excludeFolder url="file://$MODULE_DIR$/target" /> | ||
</content> | ||
</component> | ||
<component name="SonarLintModuleSettings"> | ||
<option name="uniqueId" value="8fddd795-bb5b-4d86-8a08-26419d6f01ba" /> | ||
</component> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
## mongodb-legacy (Deprecated) | ||
|
||
The mongodb-legacy library adds support for the MongoDB document store. By adding the dependency you get the | ||
full support to interact with MongoDB databases including an in-memory database for tests. | ||
|
||
This library uses the mongodb-driver-legacy mongo driver for java. | ||
|
||
### Connection properties | ||
|
||
The following settings are possible: | ||
|
||
* `mongodb.type` - {fake|real} connect to real MongoDB database or in-memory version using `Mongo Java Server` | ||
* `mongodb.name` - the name of the database to use for data storage | ||
* `mongobee.enabled` - {true|false} use mongobee for database migration | ||
* `mongobee.basepackage` - the base package of the Mongobee changesets | ||
* `mongodb.demodata` - {true|false} load demodata on startup from ND-JSON files | ||
|
||
For connections to real MongoDB databases, these extra properties can be set: | ||
|
||
* `mongodb.host` - the host of the MongoDB instance (default: localhost) | ||
* `mongodb.port` - the port of the MongoDB instance (default: 27017) | ||
* `mongodb.uri` - instead of host and port you can specify the complete connection string | ||
* `mongodb.sockettimeout` - the socket timeout of the connection (default: 10 seconds) | ||
* `mongodb.connecttimeout` - the connection timeout of the connection attempt (default: 10 seconds) | ||
|
||
### Access to database | ||
|
||
To get access to the database inject the `MongoDBDataAccess<T>` for your entity class into your bean. | ||
You can then call several methods to query and write data. | ||
|
||
### Abstract entity and DAO interface | ||
|
||
The library provides a general purpose DAO interface (`ICrudDAO`) and an abstract implementation | ||
(`AbstractMongoDAO`) with many helper methods to ease the development of the data layer. For this to | ||
work your entities have to extend the `AEntity` superclass. The DAOs created have integrated support | ||
for JodaTime classes. If you want to use polymorphic types in your entities make sure to implement | ||
`@IMappedSupertype` on the super class. This advises the Jackson mapper to include type information | ||
into the created JSON for deserialization. | ||
|
||
### Changesets | ||
|
||
For database migration purpose the mongobee library is included and is configured as denoted above | ||
using system properties. See the mongobee documentation on how to implement changesets. | ||
For Index creation take a look at the `ChangelogUtil` helper class. | ||
|
||
### MongoDBInit | ||
|
||
To prefill the database with startup data or test data for integration tests put file on your classpath | ||
into the package `mongodb` and name them using the following pattern: `<CollectionName>.ndjson` | ||
If you set the system property `mongodb.demodata`to `true` dvalin will populate the given collections | ||
with the objects contained in this new-line delimited files. Just put one JSON object per line. | ||
|
||
### DocumentLinks | ||
|
||
Another feature of dvalin's MongoDB support are DocumentLinks. These allow for references between your | ||
documents. To include a reference in one of your entities just add a field of the generic type | ||
`DocumentLink` and let your referenced entity implement `AReferenceableEntity`. | ||
Dvalin will then include a reference to the given document in your JSON which you can resolve | ||
by injecting the `IDlinkDAO` wherever you want. |
Oops, something went wrong.