Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions FEATURES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* [Fields Stored as JSON](#fields-stored-as-json)
* [Custom Naming Strategies](#custom-naming-strategies)
* [Providing your own ObjectMapper](#providing-your-own-objectmapper)
* [Working with hubspot-immutables](#working-with-hubspot-immutables)

## How does Rosetta work?

Expand Down Expand Up @@ -211,3 +212,17 @@ level, you would do the following while setting up your `DBI`:
To set at the handle or statement level would look similar:
`new RosettaObjectMapperOverride(myOtherObjectMapper).override(handle);`
`new RosettaObjectMapperOverride(myOtherOtherObjectMapper).override(query);`

## Working with hubspot-immutables

`hubspot-immutables` provides a preconfigured [immutables](https://immutables.github.io/) [style](https://immutables.github.io/style.html) for generating immutable pojos, as well as other customizations that make working with immutables easier. Most of these features will work out of the box with Rosetta, however some depend on customizations of the `ObjectMapper` in order to function properly, which causes problems when interacting with Rosetta. In order to support these usecases, `RosettaImmutables` provides the [RosettaImmutablesModule](https://github.com/HubSpot/Rosetta/blob/218547991994d631206eff4950f54fe2272c5fd2/RosettaImmutables/src/main/java/com/hubspot/rosetta/immutables/RosettaImmutablesModule.java) that you can use in combination with the `RosettaObjectMapperOverride` like so:

```java
ObjectMapper newRosettaMapper = myOtherObjectMapper
.copy()
.registerModule(new RosettaImmutablesModule());

new RosettaObjectMapperOverride(newRosettaMapper).override(handle)
new RosettaObjectMapperOverride(newRosettaMapper).override(query)
```