1

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

Tarken
  • 2,112
  • 2
  • 23
  • 42

1 Answers1

2

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.

DataNucleus
  • 15,497
  • 3
  • 32
  • 37
  • Yeah just came to the same solution :-) works fine. I was looking for the JDOQL way to do it. – Tarken Dec 12 '12 at 13:42