Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8262035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T03:37:29+00:00 2026-06-08T03:37:29+00:00

I use OpenJPA 2.1 on WebSphere Application Server with a MySQL 5 DB. I

  • 0

I use OpenJPA 2.1 on WebSphere Application Server with a MySQL 5 DB.

I have a list of dates and want to use the IN operator to get only the entries from DB where the date in DB is also in the list.

List<Date> dates = new LinkedList<Date>();
dates.add(somedates);

My query looks like this:

  List<Object> list = em
    .createNativeQuery(
        "SELECT w.date FROM week_table w WHERE w.date IN ?1")
        .setParameter(1, dates).getResultList();

But I get an ArgumentException:
org.apache.openjpa.persistence.argumentexception the specified parameter of type is not a valid query parameter

Exception in thread "main" <openjpa-2.1.1-SNAPSHOT-r422266:1141200 nonfatal user error> org.apache.openjpa.persistence.ArgumentException:org.apache.openjpa.persistence.argumentexception the specified parameter of type "class java.util.LinkedList" is not a valid query parameter.
    at org.apache.openjpa.jdbc.sql.DBDictionary.setUnknown(DBDictionary.java:1426)
    at org.apache.openjpa.jdbc.kernel.SQLStoreQuery$SQLExecutor.executeQuery(SQLStoreQuery.java:218)
    at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1005)
    at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:863)
    at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:794)
    at org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:542)
    at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:315)
    at org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:331)

So how can I pass a List or the List Values into my query?

Best Regards
Veote

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T03:37:31+00:00Added an answer on June 8, 2026 at 3:37 am

    Try using a JPQL (non native) query?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I use OpenJPA 2.2.0 on WebSphere Application Server 8 with a MySQL 5.0 DB.
I use OpenJPA 2.1 on WebSphere Application Server 8. I have a bidirectional oneToMay
I use OpenJPA on WebSphere Application Server. My WebApplication uses JSF 2 (without EJB).
My application is a store selling fishes, aquariums etc. I want to get a
We have to rename persistence.xml to fool WebSphere 7 not to use its built-in
I use IBM RAD 8 and deploy to websphere and then I get this
Use case: we have some project meta-data files which we want tracked, but are
I am new to openJPA. I have a scenario where, depending upon the server
We have a batch application using OpenJPA. We are specifying all the DB connection
I want to not use the built in Websphere 7 jpa plugin, instead use

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.