Delete Not Working with JpaRepository

前端 未结 12 2052
情书的邮戳
情书的邮戳 2020-12-07 11:55

I have a spring 4 app where I\'m trying to delete an instance of an entity from my database. I have the following entity:

@Entity
public class Token impleme         


        
12条回答
  •  暖寄归人
    2020-12-07 12:31

    Your initial value for id is 500. That means your id starts with 500

    @SequenceGenerator(name = "seqToken", sequenceName = "SEQ_TOKEN",
    initialValue = 500, allocationSize = 1)
    

    And you select one item with id 1 here

     Token deleted = tokenRepository.findOne(1L);
    

    So check your database to clarify that

提交回复
热议问题