针对com.Couchbase.client.java.query.dsl.Sort问题有哪些解决方案?

dly7yett  于 2022-10-23  发布在  Hbase
关注(0)|答案(1)|浏览(119)

这是获取类时的错误之一,

import com.bookingsite.acme.config.document.paymentoption.PaymentGatewayConfiguration;
import com.bookingsite.acme.config.dto.paymentgatewaysearchrequest.PaymentGatewayConfigSearchRequestDTO;
import com.bookingsite.acme.config.dto.paymentgatewaysearchrequest.PaymentOptionsDTO;
import com.couchbase.client.java.query.dsl.Sort;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Getter
@Setter
public class PaymentGatewaySearchData {

    private String searchQuery;
    private Sort sort;
    private int offset;
    private int limit;
    private int totalCount;

    private List<PaymentGatewayConfiguration> paymentGatewaySearchResponseList;

    private PaymentGatewayConfigSearchRequestDTO paymentGatewayConfigSearchRequestDTO;

    private List<PaymentOptionsDTO> paymentOptions;

}

我将Spring Boot版本升级到2.7.4,目前我们使用Couchbase到SDK3版本。在那之后得到这个错误。
其他常用方法

public Sort getOrderByQuery(
            PaymentTemplateConfigSearchFilterRequestDTO paymentTemplateConfigSearchFilterRequestDTO) {

        if (validateOrderBy(paymentTemplateConfigSearchFilterRequestDTO)) {
            if (paymentTemplateConfigSearchFilterRequestDTO.getSortDirection().equals(SortDirectionDTO.DESCENDING)) {
                return Sort.desc(paymentTemplateConfigSearchFilterRequestDTO.getSortBy().getAction());
            } else {
                return Sort.asc(paymentTemplateConfigSearchFilterRequestDTO.getSortBy().getAction());
            }

        } else {

            return Sort.desc(N1QlQueryConstants.TEMPLATEMODIFIEDDATE);

        }

    }

最好的选择是什么?

0mkxixxg

0mkxixxg1#

我想编译器是在抱怨com.couchbase.client.java.query.dsl.Sort不存在。
This Couchbase Forum post解释了为什么SDK 2中的com.couchbase.client.java.query.dsl中的类没有被带入SDK 3。
如果您希望继续使用DSL类,建议将the relevant source code from SDK 2复制到您的项目中。

相关问题