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 725891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:23:21+00:00 2026-05-14T06:23:21+00:00

I want to build the following pseudo query Select a From APDU a where

  • 0

I want to build the following pseudo query

Select a From APDU a where a.group.id= :id

group is a field in APDU class of the type APDUGroup.class.

I just want to get a list of APDUs based on APDUGroup’s id.

How do i do that using a standard JPA query?

UPDATE

Yes, I have tried the above query and tried other variations for hours before posting in S/O. Here is the generated SQL for the query above:

SELECT t1.ID, t1.status, t1.type, t1.modified, t1.response, t1.expectedSize, t1.created, t1.description, t1.sequence, t1.name, t1.command, t1.recurring, t1.auth, t1.createdBy, t1.APDUGroup, t1.modifiedBy FROM APDUGroup t0, APDU t1 WHERE ((t0.ID = ?) AND (t0.ID = t1.APDUGroup))

The query looks okay but nothing get selected from my table.
There are at least 100 APDUs with APDUGroup = 1 in my test database.

I’m using eclipselink as the JPA provider.

  • 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-05-14T06:23:22+00:00Added an answer on May 14, 2026 at 6:23 am

    Given the following Entities:

    @Entity
    public class APDU implements Serializable {
        @Id
        @GeneratedValue
        private Long id;
    
        @ManyToOne
        private APDUGroup group;
    
        //...
    
    }
    
    @Entity
    public class APDUGroup implements Serializable {
        @Id
        @GeneratedValue
        private Long id;
    
        //...
    }
    

    The following query will return a list of APDUs for a given APDUGroup id:

    select a from APDU a where a.group.id = :id
    

    Oh, wait, that’s your query 🙂

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

Sidebar

Related Questions

I want to build the following XML node from a class. <Foo id=bar>some value</Foo>
I want to build a rails query like the following. And would like to
I want to build a bot that basically does the following: Listens to the
I want build a sketch pad app on iPhone, I assume that this type
i want to build a screen for user to get his marks on competitions,
I want to build a python program that deletes all the photos from my
I want to build a shell script to execute the following two commands, but
I want to build a visual table where I can see the following things:
i want to build a feed for freelancer.com , i did the following ,
I am stuck trying to build the following SQL query in JPA (still new

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.