Mapping enum to string in hibernate

前端 未结 2 1507
暗喜
暗喜 2021-02-03 16:23

I\'ve got a Category Hibernate model:

@Entity
@Table(name = \"category\")
public class Category {

    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
             


        
2条回答
  •  你的背包
    2021-02-03 17:07

    The accepted answer is not sufficient for PostgreSQL. I attach the implementation that worked for me:

    https://stackoverflow.com/a/64021041/5279996

提交回复
热议问题