6.HQL表达式Syntax from DomesticCat cat where cat.name between 'A' and 'B' from DomesticCat cat where cat.name in ('Foo', 'Bar', 'Baz') from DomesticCat cat where cat.name not between 'A' and 'B' from DomesticCat cat where cat.name not in ('Foo', 'Bar', 'Baz')
之所以要这样的功能,是因为解决在网页上用户输入多个关键字查询,例如:a b c(空格分隔),而且输入的关键字是数量不定的,如果用多个and语句连接太麻烦
同意
大部分关键字都一样
from DomesticCat cat where cat.name between 'A' and 'B'
from DomesticCat cat where cat.name in ('Foo', 'Bar', 'Baz')
from DomesticCat cat where cat.name not between 'A' and 'B'
from DomesticCat cat where cat.name not in ('Foo', 'Bar', 'Baz')