Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds a jsonb user type to handle more complex documents #339

Merged
merged 2 commits into from
Feb 13, 2019
Merged

Adds a jsonb user type to handle more complex documents #339

merged 2 commits into from
Feb 13, 2019

Conversation

hwbllmnn
Copy link
Member

@hwbllmnn hwbllmnn commented Jan 28, 2019

This enables us to incorporate PostgreSQL jsonb fields into object graphs.

Use it like this:

    @org.hibernate.annotations.Type(type="de.terrestris.shogun2.hibernate.JsonbUserType")
    private Map<String, Object> custom;

and add the appropriate getter/setter as needed. The stored json can be of any depth and will be incorporated as the value of the custom field of the annotated entity transparently.

@terrestris/devs Please review.

@hwbllmnn hwbllmnn changed the title WIP: Adds a jsonb user type to handle more complex documents Adds a jsonb user type to handle more complex documents Feb 7, 2019
@hwbllmnn hwbllmnn merged commit 1a1b5da into terrestris:master Feb 13, 2019
@hwbllmnn hwbllmnn deleted the add-jsonb-user-type branch February 13, 2019 13:49
return null;
}
HashMap map = mapper.readValue(string, HashMap.class);
System.out.println(map);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🥇

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦆 #341

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants