sql - SpringData jparepository AND / OR operators -


i need jparepository:

 select * table (   propertytwo '%something%'   or propertythree '%something%'   or propertyfour  '%something%' ) , propertyone in (a,b); 

i this:

 findbypropertyoneinandpropertytwocontainingorpropertythreecontainingorpropertyfourcontaining(list param1, string param2, string param3, string param4) 

but method this:

 select * table   propertytwo '%something%'   or propertythree '%something%'   or propertyfour  '%something%'   , propertyone in (a,b); 

which different first sql query above.

how can achieve correct result?

like slava said, should do:

@query("from table t t.propertyone in :param1 , (t.propertytwo :param2 or t.propertythree :param3 or t.propertyfour :param4)") list<table> findbyparams(@param("param1") list<string> param1, @param("param2") string param2, @param("param3") string param3, @param("param4") string param4); 

Comments

Popular posts from this blog

c# - Unity IoC Lifetime per HttpRequest for UserStore -

Change the color of an oval at click in Java AWT -

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -