Connect with one of the following accounts


Please wait while we redirect...

Views: 2073 Ask New Question

I have following code in my POJO

@GeneratedValue(strategy = GenerationType.AUTO)
private long id;

On startup Hibernate giving me the following warning

HHH90000014: Found use of deprecated [] sequence-based id generator;
use instead. 
See Hibernate Domain Model Mapping Guide for details.
On By

1 Answer

Start using GenericGenerator for sequence generation.

declare your GenericGenerator with the following code

            name = "userSequenceGenerator",
            strategy = "",
            parameters = {
                    @Parameter(name = "sequence_name", value = "userSequence"),
                    @Parameter(name = "initial_value", value = "1"),
                    @Parameter(name = "increment_size", value = "1")

and start using it for your id field

    @GeneratedValue(generator = "userSequenceGenerator")
    private Long id;
On By

Answer This Question

Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News