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

Add a new recipe to migrate to io.hypersistence:hypersistence-utils-hibernate:6 types #3

Open
iuliiasobolevska opened this issue Jun 6, 2023 · 1 comment
Labels
good first issue Good for newcomers recipe

Comments

@iuliiasobolevska
Copy link
Contributor

What problem are you trying to solve?

What precondition(s) should be checked before applying this recipe?

Should use io.hypersistence:hypersistence-utils-hibernate-60 or io.hypersistence:hypersistence-utils-hibernate-62.
Note: I logged a separate issue for package group changes: #4 since that one is trivial to do and requires fewer things to be considered.

Describe the situation before applying the recipe

From https://github.com/vladmihalcea/hypersistence-utils#hibernate-5:

@Type(type = "json")
private Map<String, String> properties = new HashMap<>();

Describe the situation after applying the recipe

From https://github.com/vladmihalcea/hypersistence-utils#hibernate-6:

@Type(JsonType.class)
private Map<String, String> properties = new HashMap<>();

Any additional context

We used to also apply

@TypeDefs({@TypeDef(name = "json", typeClass = JsonStringType.class)})

at the class level. If I read migration guide correctly these annotations should be removed by the recipe.

@timtebeek
Copy link
Contributor

Thanks again for the clear before/after description and helpful links to the documentation! As opposed to #4 this change would indeed require a custom recipe and visitor, but not a particular tough one to implement I think.

I'd invite anyone that wants to pick this up to start with a couple unit tests to capture the before and after situation you've described above, and open a draft pull request to kick start development. Even if you're unsure whether you'd be able to complete the recipe, it's a good way to work towards a solution.

In time, if we develop more custom hibernate migration recipes we might even consider starting a separate rewrite-hibernate repository, and invite people like Vlad to contribute recipes to migrate their users over the newer versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers recipe
Projects
Status: Recipes Wanted
Development

No branches or pull requests

2 participants