@IdPrefix (and other similar) annotations not working at all



I saw a sample usage of @IdPrefix (and other similar) here. I am trying to store a document in the DB but somehow the key is still without prefix (or suffixes that i use!)

Unlike in the above link, I am using ReactiveCouchbaseRepository to save the doc (rather than template). The following is the relevant code sample.

the model class

@EqualsAndHashCode(of = {"id"})
public final class User {

private static final String DOC_TYPE = "user";

@GeneratedValue(strategy = GenerationStrategy.USE_ATTRIBUTES, delimiter = "::")
private final String id;

private String prefix = DOC_TYPE;


the test class

public class UserRepositoryTest {

private static final User TEST_USER = User.createNew(Status.NEW, asList(new Profile(ProfileName.DOCTOR, Status.NEW)));

UserApplication.UserRepository userRepository;

public void shouldSaveUser() throws ParseException {
    final User user = User.createNew(/*...populate values, including id.../*);


Here, post this method is executed, the doc stored does not have the prefix in the doc stored in the db. Any help would be appreciated. Thanks in advance.