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 "USER****" and it should be of uniform length. e.g. USER0012, USER0007, USER1409 etc. And also want each time next user id will get generate.
I am new to Spring JPA, I know we can generate long or int type of primary key with @GeneratedValue(strategy = GenerationType.IDENTITY)
or @GeneratedValue(strategy = GenerationType.AUTO)
, but is there any inbuilt mechanism for this?