springdatajpa添加完modle之后立即返回id

需要在id的get方法上加上

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)

猜你喜欢

转载自www.cnblogs.com/krlin/p/9930346.html