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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:39:04+00:00 2026-06-15T04:39:04+00:00

Consider this use case : a mysql table X and a java JPA entiy

  • 0

Consider this use case :
a mysql table X and a java JPA entiy X.

create table X 
(id int(11),
 name varchar(200),
 value1 bigint(16),
 value2 bigint(16),
 value3 bigint(16),
 .
 .
 value100 bigint(16));

I would like to map to an entity like this :

@Entity("x")
@Table("x")
public class X {

@Id
@Column("id)
public int getId ...

@Column("name")
public String getName ..

@SomeMagicalExpression
public List<Long> getValues()..
}

I am well aware of the option to create a join table where each value is a row, I am trying to get away from performing joins.
I would really hate to create a 100 getters and setters.

  • 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-15T04:39:05+00:00Added an answer on June 15, 2026 at 4:39 am

    Bit of a shot in the dark, but maybe the OpenJPA @Columns annotation will suit your needs..

    http://docs.oracle.com/html/E24396_01/ref_guide_mapping_custom.html#ref_guide_mapping_custom_field_conf_extex

    Not sure if you could use it to map multiple columns to a collection though.. Maybe subclass ArrayList and override its constructor to take in a number of values to populate the list. (If my assumption that the values used in @Columns must correspond to a constructor is correct..)

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

Sidebar

Related Questions

Consider this class: case class Person(val firstName: String, val lastName: String, age: Int) val
I use boost.program_options library. Consider this simplified case. po::options_description desc(Usage); desc.add_options() (uninstall,u, uninstall program)
Consider this use case scenario: I wish to auto complete and provide the skeleton
Consider this code (Java, specifically): public int doSomething() { doA(); try { doB(); }
Consider this scenario. I have my own website, that I use as my identifier,
Consider this simple model: A base Location table: +-------------------------------+ | Locations | +-------------------------------+ |(PK)
Consider this simple example - public class Person { private String name; private Date
Consider this program: #include <stdio.h> int main() { printf(%s\n, __FILE__); return 0; } Depending
My use case is this: I am working on a new feature and I
Consider this if params['image'].nil? In html's case, I used the above and it checked

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.