域类如下:
@NodeEntity
public class Product{
private Long nodeId;
@Indexed(indexName = "productCode")
private String code;
...
}
存储库类:
public interface ProductRepository extends GraphRepository<Product>{
@Query(value="start product=node:productCode(code={0}) return product")
public Set<Product> findProducts(String code);
}
如何使代码查找不区分大小写? 我尝试正则表达式并失败。编码如下:
public interface ProductRepository extends GraphRepository<Product>{
@Query(value="start product=node:productCode(code=~{0}) return product")
public Set<Product> findProducts(String code);
}
我知道一种方法有效,但性能不佳,代码如下:
public interface ProductRepository extends GraphRepository<Product>{
@Query(value="start product=node:__types__(className='Product') where product.code='~{0}' return product")
public Set<Product> findProducts(String code);
}