Couchbaseのための春のデータ:の使用とANY ...満たしています

サンドロ・レイ:

私は、データベースとしてSpringBootをCouchbaseのを使用しての使用と春データおよびロンボクはゲッターをFOTと私は、このリポジトリを作成した方法に等しいことをSpringBoot 2アプリを持っています

@ViewIndexed(designDoc = "bendicionesDoc")
public interface BenRepository extends CouchbaseRepository<BendicionesDoc, String> {

    @Query("#{#n1ql.selectEntity} where #{#n1ql.filter} AND ANY uuid IN data.identifier.id SATISFIES uuid = $1 END")
    List<BendicionesDoc<Item>> findById(String id);


}

ここロンボクライブラリで作成されたすべてのオブジェクト

public class BendicionesDoc<T>implements Serializable {


        @Field
        private T data;

    }

そして

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(NON_NULL)
public class Item {

    private List<Identifier> identifier;


}

そして

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(NON_NULL)
@EqualsAndHashCode
public class Identifier {

    private String id;
    private MasterServant idContext;
    private MasterServant idScope;

}

そして

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@JsonInclude(NON_NULL)
@EqualsAndHashCode(onlyExplicitlyIncluded = true)
public class MasterServant {

    private String context;
    @JsonValue
    @EqualsAndHashCode.Include
    private String value;

    private Name valueDescription;

    @JsonCreator
    public MasterServant(String value) {
        this.value = value;
    }

}

私は、私は常に0の結果を得たリポジトリクエリを実行するときしかし、でも、ドキュメントがあります。DBで:

ジョナサンJOhx:

あなたは、あなたを定義する必要がreference typeCouchbaseRepository<T, K>単にその後、参照型を追加しItemCouchbaseRepository<BendicionesDoc<Item>, String>、ちょうど使用リポジトリクエリキーワードをためfindById(String id)

public interface BenRepository extends CouchbaseRepository<BendicionesDoc<Item>, String> { 

    List<BendicionesDoc<Item>> findById(String id);

}

おすすめ

転載: http://43.154.161.224:23101/article/api/json?id=313412&siteId=1
おすすめ