title: How to create auto generated primary key for string in Spring JPA?
body: <p>I want to create a primary key of String type, which will be auto-generated by Spring JPA. I want that the primary key should start with &quot;USER****&quot; and it should be of uniform length. e.g. USER0012, USER0007, USER1409 etc. And also want each time next user id will get generate.</p>
  <p>I am new to Spring JPA, I know we can generate long or int type of primary key with <code>@GeneratedValue(strategy = GenerationType.IDENTITY)</code> or <code>@GeneratedValue(strategy = GenerationType.AUTO)</code>, but is there any inbuilt mechanism for this?</p>