为了账号安全,请及时绑定邮箱和手机立即绑定

Couchbase 的 Spring Data:使用 AND ANY ... SATISFIES

Couchbase 的 Spring Data:使用 AND ANY ... SATISFIES

MM们 2023-11-01 17:06:41
所以我想制作一个命令行计算器,它在“Calculator”一词之后接受多个参数。但使用以下代码我无法实现它。在这两种方法中,gradle 都会在显示单词“Calculator”之前等待读取该行。使用扫描仪System.out.print("Calculator ");Scanner sc = new Scanner(System.in);String inputString;inputString = sc.nextLine();String[] args = inputString.split( "\\s+" );使用BufferReaderBufferedReader br = new BufferedReader(new InputStreamReader(System.in));System.out.print("Calculator ");String str= br.readLine();String[] args = str.split( "\\s+" );但是 System.out.println("Calculator ") 显示该单词没有任何问题。但它并不在一条线上。所以它不能按我想要的方式工作。更改代码行的顺序也没有帮助。System.Console().printf() 也不是一个选项,因为我使用的是 Intellij IDEA。那么有人可以帮我解决这个问题,以便我可以获得内联输入阅读器。我还尝试通过在方法中单独实现来同步打印方法。那效果不太好。最后我想要实现的是以下格式计算器 最大 12 23 25 45这里斜体是要读取的输入。粗体部分应由程序打印。这是完整的代码
查看完整描述

1 回答

?
倚天杖

TA贡献1828条经验 获得超3个赞

您需要定义您的reference typein CouchbaseRepository<T, K>,然后只需添加引用类型ItemasCouchbaseRepository<BendicionesDoc<Item>, String>并仅使用存储库查询关键字for findById(String id)

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

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

}


查看完整回答
反对 回复 2023-11-01
  • 1 回答
  • 0 关注
  • 57 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信