Hibernate returns BigIntegers instead of longs

后端 未结 5 1367
猫巷女王i
猫巷女王i 2021-01-07 23:21

This is my Sender entity

@Entity
public class Sender {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long senderId;
...


...

    p         


        
5条回答
  •  一生所求
    2021-01-07 23:57

    Adding to #Hedley comment to fix it globally you can add a line in SQLDialect constructor. In my project it was like:

    public PostgreSQLDialect() {
            super();
            registerHibernateType(Types.BIGINT, StandardBasicTypes.LONG.getName());
        }
    

提交回复
热议问题