Spring-data-couchbase not working as expected. I must be doing something very wrong

The following test illustrates various issues I encounter with Spring Data Couchbase.
I must be doing something very wrong but cannot figure it out.
Id is null after save.
Documents seem to be ‘embedded’ instead of ‘linked to’ because changing the original and saving doesn’t affect the ‘linked’ document.

The code below is in a repo that can be used to recreate the issues:
public void testSaveGroupAndUser() throws ParseException {
UserInfo user = new UserInfo();
user.setFullName(“Joe Soap”);
if (user.getId() == null) {
log.error(“userInfo.id is null”);
// Loading by name to ensure id is populated
user = userInfoRepository.findOneByUserId(“joe”);
GroupInfo groupInfo = new GroupInfo(“group1”, user);
if (groupInfo.getId() == null) {
log.error(“groupInfo.id is null”);
log.info(“groupInfo:saved:{}”, groupInfo.getId());
// Loading by name to ensure id is populated
groupInfo = groupInfoRepository.findByGroupName(“group1”);
GroupMember member = new GroupMember(groupInfo, user, true);
if (member.getId() == null) {
log.error(“member.id is null”);
user.setFullName(“Joe Soap Modified”);
for (GroupMember groupMember : groupMemberRepository.findAll()) {
log.info(“member:{}”, groupMember);
if (groupMember.getMember().getId() == null) {
log.error(“groupMember.member.id is null”);
if (groupMember.getMemberOfgroup().getId() == null) {
log.error(“groupMember.memberOfgroup.id is null”);
// user was modified after groupMember was written which means reading should retrieve modified user
assertEquals(“Joe Soap Modified”, groupMember.getMember().getFullName());

@corneil as far as I know we only support storing it embedded and not through linking, but @subhashni is the authority here lets wait what she has to say whats going on here :slight_smile: