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

Since we are using new Hibernate version should we also "improve" the entities? The strategy is deprecated from Hibernate 6.2 and instead we replace with type: #278

Open
fredysierra opened this issue Nov 2, 2023 · 0 comments

Comments

@fredysierra
Copy link
Contributor

          Since we are using new Hibernate version should we also "improve" the entities? The `strategy` is deprecated from Hibernate 6.2 and instead we replace with `type`:
strategy = "enhanced-sequence
to
type = SequenceStyleGenerator.class 
    @GenericGenerator(
        name = "sequenceGenerator",
        type = SequenceStyleGenerator.class,
        parameters = {
            @org.hibernate.annotations.Parameter(
                name = "optimizer",
                value = "pooled-lo"
            ),
            @org.hibernate.annotations.Parameter(
                name = "initial_value",
                value = "1"
            ),
            @org.hibernate.annotations.Parameter(
                name = "increment_size",
                value = "5"
            ),
            @org.hibernate.annotations.Parameter(
                name = "sequence_name",
                value = "hibernate_sequence"
            )
        }
    )

https://github.com/Backbase/golden-sample-services/blob/main/services/product/src/main/java/com/backbase/goldensample/product/persistence/ProductEntity.java#L40

https://docs.jboss.org/hibernate/orm/6.0/javadocs/org/hibernate/annotations/GenericGenerator.html#strategy()

Note: This for all entities.

Originally posted by @eacarvalho in #260 (comment)

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

No branches or pull requests

1 participant