[PersistenceException: Error getting sequence nextval]

前端 未结 3 953
忘掉有多难
忘掉有多难 2021-01-18 15:57

i am getting this error while trying to save data into model in db.

@Entity
public class User extends Model {
   @Required
   public String name; 
   @Email         


        
3条回答
  •  伪装坚强ぢ
    2021-01-18 16:16

    This worked for me on class annotation:

    @SequenceGenerator(name = "SEQUENCE_NAME", sequenceName = "PST_BUSINESS.S_BUSINESS_DOMAIN")
    @Entity
    @Table(name = "TB_BUSINESS_DOMAIN", schema = "PST_BUSINESS")
    public class PstBusinessDomain extends PstAbstractBaseMappedEntity {
    

    As Leo said, this strategy works for annotation in the field and also in the class.

提交回复
热议问题