0

Hello am back searching for help: when i INSERT datas into my H2 console databse, i get negative id Values and all my fields have the "NULL" value.

 @Entity
 @Table(name = "tcustomer")
 public class Customer implements Serializable{

    private static final long serialVersionUID = 1L;

@Id
@SequenceGenerator(name = "pk_sequence",sequenceName = "sequence_tcustomer", initialValue = 1000, allocationSize = 100)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "pk_sequence")
private Long uidpk;

Help me please Thks

Here is an image of my H2 console database :
H2 DataBase

F0XS
  • 1,271
  • 3
  • 15
  • 19
solo
  • 338
  • 4
  • 16
  • Possible duplicate of [H2 Sequence is generating Negative No. in Column \[JPA Spring\]](https://stackoverflow.com/questions/47896049/h2-sequence-is-generating-negative-no-in-column-jpa-spring) – Simon Martinelli Jan 15 '18 at 16:07
  • i have checked my Sequences, none of them is duplicated. – solo Jan 15 '18 at 16:11
  • 'this my properties into my application.yml
    hibernate.jdbc.batch_size: 100, hibernate.order_inserts: true, hibernate.order_updates: true, hibernate.jdbc.batch_versioned_data: true, hibernate.id.new_generator_mappings: true'
    – solo Jan 15 '18 at 16:37
  • For the solutions review this url https://stackoverflow.com/questions/33172805/hibernate-table-generator-inserting-negative-primary-keys-in-table/66877645#66877645 – Francisco Schnabel Mar 30 '21 at 20:00

0 Answers0