// Path: spring-data-couchbase-demo/src/main/java/org/springframework/data/demo/data/GroupInfo.java
// @Document
// @Data
// @EqualsAndHashCode(of = "groupName")
// public class GroupInfo {
// 	@Id
// 	@GeneratedValue(strategy = GenerationStrategy.UNIQUE)
// 	private String id;
// 
// 	@NotNull
// 	@Field
// 	private String groupName;
// 
// 	@NotNull
// 	@Field
// 	private UserInfo groupOwner;
// 
// 	public GroupInfo() {
// 		super();
// 	}
// 
// 	public GroupInfo(String groupName, UserInfo groupOwner) {
// 		super();
// 		this.groupName = groupName;
// 		this.groupOwner = groupOwner;
// 	}
// }
// 
// Path: spring-data-plain-demo/src/main/java/org/springframework/data/demo/data/GroupMember.java
// @Entity
// @org.springframework.data.mongodb.core.mapping.Document
// @Data
// @EqualsAndHashCode(of = {"member", "memberOfgroup"})
// public class GroupMember {
//     @NotNull
//     private Boolean enabled;
//     // Using a string id for use in both MongoDB and JPA.
//     @Id
//     @com.couchbase.client.java.repository.annotation.Id
//     @GeneratedValue(generator = "system-uuid")
//     @GenericGenerator(name = "system-uuid", strategy = "uuid2")
//     private String id;
//     @NotNull
//     @ManyToOne
//     @DBRef
//     private UserInfo member;
//     @NotNull
//     @ManyToOne
//     @DBRef
//     private GroupInfo memberOfgroup;
// 
//     public GroupMember() {
//         super();
//     }
// 
//     public GroupMember(GroupInfo memberOfgroup, UserInfo member, Boolean enabled) {
//         super();
//         this.memberOfgroup = memberOfgroup;
//         this.member = member;
//         this.enabled = enabled;
//     }
// }


import org.springframework.data.couchbase.core.query.N1qlPrimaryIndexed;
import org.springframework.data.couchbase.core.query.N1qlSecondaryIndexed;
import org.springframework.data.couchbase.core.query.ViewIndexed;
import org.springframework.data.couchbase.repository.CouchbaseRepository;
import org.springframework.data.demo.data.GroupInfo;
import org.springframework.data.demo.data.GroupMember;
import java.util.List;
package org.springframework.data.demo.repository;



@N1qlPrimaryIndexed
@ViewIndexed(designDoc = "groupMember")
public interface GroupMemberRepository extends CouchbaseRepository<GroupMember, String> {
	List<GroupMember> findByMemberOfgroup(GroupInfo group);
// Path: spring-data-couchbase-demo/src/main/java/org/springframework/data/demo/data/GroupInfo.java
// @Document
// @Data
// @EqualsAndHashCode(of = "groupName")
// public class GroupInfo {
// 	@Id
// 	@GeneratedValue(strategy = GenerationStrategy.UNIQUE)
// 	private String id;
// 
// 	@NotNull
// 	@Field
// 	private String groupName;
// 
// 	@NotNull
// 	@Field
// 	private UserInfo groupOwner;
// 
// 	public GroupInfo() {
// 		super();
// 	}
// 
// 	public GroupInfo(String groupName, UserInfo groupOwner) {
// 		super();
// 		this.groupName = groupName;
// 		this.groupOwner = groupOwner;
// 	}
// }
// 
// Path: spring-data-plain-demo/src/main/java/org/springframework/data/demo/data/GroupMember.java
// @Entity
// @org.springframework.data.mongodb.core.mapping.Document
// @Data
// @EqualsAndHashCode(of = {"member", "memberOfgroup"})
// public class GroupMember {
//     @NotNull
//     private Boolean enabled;
//     // Using a string id for use in both MongoDB and JPA.
//     @Id
//     @com.couchbase.client.java.repository.annotation.Id
//     @GeneratedValue(generator = "system-uuid")
//     @GenericGenerator(name = "system-uuid", strategy = "uuid2")
//     private String id;
//     @NotNull
//     @ManyToOne
//     @DBRef
//     private UserInfo member;
//     @NotNull
//     @ManyToOne
//     @DBRef
//     private GroupInfo memberOfgroup;
// 
//     public GroupMember() {
//         super();
//     }
// 
//     public GroupMember(GroupInfo memberOfgroup, UserInfo member, Boolean enabled) {
//         super();
//         this.memberOfgroup = memberOfgroup;
//         this.member = member;
//         this.enabled = enabled;
//     }
// }


// Path: spring-data-couchbase-demo/src/main/java/org/springframework/data/demo/repository/GroupMemberRepository.java
import org.springframework.data.couchbase.core.query.N1qlPrimaryIndexed;
import org.springframework.data.couchbase.core.query.N1qlSecondaryIndexed;
import org.springframework.data.couchbase.core.query.ViewIndexed;
import org.springframework.data.couchbase.repository.CouchbaseRepository;
import org.springframework.data.demo.data.GroupInfo;
import org.springframework.data.demo.data.GroupMember;
import java.util.List;

package org.springframework.data.demo.repository;



@N1qlPrimaryIndexed
@ViewIndexed(designDoc = "groupMember")
public interface GroupMemberRepository extends CouchbaseRepository<GroupMember, String> {
	List<GroupMember> findByMemberOfgroup(GroupInfo group);
	List<GroupMember> findByMemberOfgroupAndEnabledTrue(GroupInfo group);