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

  • Home
  • SEARCH
  • 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 7771203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:35:32+00:00 2026-06-01T16:35:32+00:00

i want to make pgId and pgName both as composite key where both pgId

  • 0

i want to make pgId and pgName both as composite key where both pgId anf pgName are assgined values. i am not sure how should i go about it?
on net i get examples where composite key column refering to column of some other table but not this kind of scenario?

@Entity
@Table(name = "PersonDetails")
public class PersonDetailsData implements Serializable {
  private static final long serialVersionUID    = 1L;

  @Id
  @Basic
  private int               pgId;

  @Basic(optional = true)
  @Column(nullable = true)
  private int               orgId;

  @Basic(optional = true)
  @Column(nullable = true)
  private String            pgName;


   public PersonWikiDetailsData() {
  }

  public int getPpId() {
    return ppId;
  }

  public void setPpId(int ppId) {
this.ppId = ppId;
  }

  public String getSpaceName() {
return spaceName;
  }

  public void setSpaceName(String spaceName) {
this.spaceName = spaceName;
  }

  }
  • 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-01T16:35:34+00:00Added an answer on June 1, 2026 at 4:35 pm

    In our project we have a Form entity which has a 2 part primary key like your project.

    Here is the composite key class:

    @Embeddable
    public class FormId implements java.io.Serializable
    {
        /** Generated <code>serialVersionUID</code>. */
        private static final long serialVersionUID = 906178514456716120L;
    
        /** The code of the form. */
        @Column(name = "FRM_CD", nullable = false, length = 80)
        private String formCode;
        /** The version of the form. */
        @Column(name = "FRM_VR", nullable = false, precision = 2, scale = 2)
        private BigDecimal formVersion;
    
        ...
    }
    

    and this is how it is used in the Form entity:

    /** The primary key of the form. */
    @EmbeddedId
    private FormId formId;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want make a xslt transformation to xsl-fo but I´m not really sure that
I want make sure that one thing about the transaction lock of GAE. In
I want make sql query which will insert values from one table to another
Want make a mind map like the following: Image link is not available anymore.
I want make a carousel. But not a simple carousel with images. I have
I want make datetimepicker in my project. Using jquery how it is possible? I
I want make a bash script which returns the position of an element from
I want make interactive application where user launches it and can do various task
Let's say I want make some of my sources publicly available via my blog
I am new android app developer i want make app for tablets and phone

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.