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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T00:48:21+00:00 2026-05-20T00:48:21+00:00

Via reflection I have found a lists of properties from x POJO classes which

  • 0

Via reflection I have found a lists of properties from x POJO classes which I need to display and also created a list of headings for which I will display the properties under(headings are from annotations on the fields).

The form of the POJO is that for each property I wish to display there is a getter.

Here are the details: The POJO’s are annotated with @Entity, I am executing a query (using JPA) and getting a result set. I now want to display the result set (a collection of a particular POJO) by calling the correct getters.

I can call the getters. My issue is having not done this… I worry that using reflection may not be particularly efficient on large result sets and perhaps there is a way to make JPA entity objects iterable in consistent way.

For instance if there an easy way to return each record as an indexable collection then I can just line up my headers in the order they would appear in each record and iterate. This then would not be a POJO but with encapsulation it could look that way in a part of the API.

Looking for suggestions! It will work one way or another but I would rather it be pretty.

  • 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-20T00:48:22+00:00Added an answer on May 20, 2026 at 12:48 am

    Since you are using JPA, have you tried the JPA 2 metamodel (javax.persistence.metamodel). This will give you information about your JPA entities from the JPA metadata:

    entityManager.getMetamodel().entity(entityClass). getAttributes();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a method which I would like to call via reflection. The method
I have just used proguard, but classes I am trying to instantiate via reflection
I have a type that has index properties which I want to access via
We have huge codebase and some classes are often used via reflection all over
I have a bean whose properties I want to access via reflection. I receive
I have 2 interfaces and 2 classes that I investigate via Reflection: IParent IChild
I need to be able to access a property via reflection, and, knowing that
I'm attempting to map values of properties (via reflection) between different objects. This appears
I'm using PropertyUtils.copyProperties() to copy an object's properties via reflection, and it used to
I want to create a Comparison<>-Delegate via reflection in code. I have this: var

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.