I am new to datanucleus.

Is it possible to use the Sql in operater ind JDOQL in datanucleus?

I want to use declerative JDOQL but I cannot figure out how to create a query that does what the SQL In Operater does.

SQL Query would look like this:

SELECT * FROM table WHERE id IN (1,2,3,4,5)

Thanks for helpful information

有帮助吗?

解决方案

Why would JDOQL allow some random bit of SQL? JDOQL uses Java syntax, consequently the most logical Java syntax is Collection.contains so you pass in a Collection parameter which has those 5 elements, and do

:param.contains(id)

Obviously looking at the JDO spec would tell you that, and DataNucleus does nothing different.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top