spring-boot - JPA中包含和喜欢有什么区别?
问题描述
如果我想使用模糊选择,当我使用喜欢时似乎错误,我必须使用包含。那么 JPA 中的 contains 和 like 有什么不同呢?
解决方案
两者都非常相似,根据有关容器参数的 Spring 文档,它们被绑定在 % 中,而在 Like not 中。因此,如果您想要相同的结果,请尝试使用 Like 将 % 添加到查询的参数中
推荐阅读
- sql - 在 oracle pl/sql 中添加半个月
- ios - iOS 共享表和复制选项粘贴链接在某些情况下不起作用
- javascript - 滑动检测(仅左右,不上下)
- php - IBM Cloud PHP 入门教程 - “php composer.phar install”出错
- javascript - JSZip 复制文件并在创建新 zip 时出错
- r - ggplot - 仅绘制颜色条
- html - 如何在 mat-card-image 的各个方面制作边距?
- protractor - 如何在 angular-cli 中为 e2e 指定不同的配置文件?
- android - 我正在尝试获取我当前的位置,但这显示错误。而且我还尝试使用以下代码获取我的位置,但它不起作用
- ios - 您如何解决:使用未声明的类型“NSFetchRequest”?