Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Oracle JPA/标准API-不相似_Oracle_Jpa 2.0_Predicate - Fatal编程技术网

Oracle JPA/标准API-不相似

Oracle JPA/标准API-不相似,oracle,jpa-2.0,predicate,Oracle,Jpa 2.0,Predicate,我想使用谓词notLike(表达式x,字符串模式)替换以下查询: select * from mytable where mytable.myParameter not in ('ABC%','XYZ'); 但当我使用以下谓词执行查询时: Predicate notLike = builder.notLike(fromMyTable.get(MyTable_.myParameter), "ABC%|BCD"); 它不起作用 但是如果我为这两个字符串创建两个谓词:“ABC%”和“XYZ”正在工

我想使用谓词notLike(表达式x,字符串模式)替换以下查询:

select * from mytable
where mytable.myParameter not in ('ABC%','XYZ');
但当我使用以下谓词执行查询时:

Predicate notLike = builder.notLike(fromMyTable.get(MyTable_.myParameter), "ABC%|BCD");
它不起作用

但是如果我为这两个字符串创建两个谓词:“ABC%”和“XYZ”正在工作

我的模式写错了吗?问题出在哪里?我试图用多种方式改变这种模式,但仍然不起作用

谢谢大家!

在SQL
A not In(X,Y,Z)
谓词是以下条件的快捷方式:

A <> X AND A <> Y AND A <> Z

从mytable中选择*
其中mytable.myParameter“XYZ”
mytable.myParameter与“ABC%”不同;
select * from mytable
where mytable.myParameter not in ('XYZ')
  and mytable.myParameter not LIKE 'ABC%';
select * from mytable
where mytable.myParameter <> 'XYZ'
  and mytable.myParameter not LIKE 'ABC%';