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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:16:55+00:00 2026-05-28T02:16:55+00:00

I have tried to follow the instructions here http://docs.oracle.com/cd/B31017_01/web.1013/b28221/cmp30cfg001.htm Along with using generic model.

  • 0

I have tried to follow the instructions here

http://docs.oracle.com/cd/B31017_01/web.1013/b28221/cmp30cfg001.htm

Along with using generic model. I end up with a primary key class as follows

import javax.persistence.Embeddable;
import java.io.Serializable;

@Embeddable
public class DailyPK implements Serializable {

    private int match_id;
    private int user_id;

    public int getUser_id() {
        return user_id;
    }

    public void setUser_id(int user_id) {
        this.user_id = user_id;
    }

    public int getMatch_id() {
        return match_id;
    }

    public void setMatch_id(int match_id) {
        this.match_id = match_id;
    }

    public int hashCode() {
        return match_id * 1000000 + user_id;
    }

    public boolean equals(Object obj) {
        if (obj == this) return true;
        if (!(obj instanceof DailyPK)) return false;
        if (obj == null) return false;
        DailyPK pk = (DailyPK) obj;
        return pk.match_id == match_id && pk.user_id == user_id;
    }
}

My model class is as follows which does not compile

public class Daily extends GenericModel {

    @Id
    DailyPK primaryKey;


    public int round;
    public int score;


    public Daily(int round, int score) {
        this.round = round;
        this.score = score;
    }

    @EmbeddedId
    public DailyPK getPrimaryKey() {
        return primaryKey;
    }

    public void setPrimaryKey(DailyPK pk) {
        primaryKey = pk;
    }

}

What modifications do I need to make?

  • 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-28T02:16:56+00:00Added an answer on May 28, 2026 at 2:16 am

    When extending GenericModel you need to Override _key method

    @Override
    public Object _key() {
        return getPrimaryKey();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have followed all the instructions here: http://www.tonyspencer.com/2003/10/22/curl-with-php-and-apache-on-windows/ to install & config apache get
I have tried to follow the instructions in Installing and Configuring Web Deploy for
I'm looking to use jScrollPane's scrollToElement API function here: http://dextersgospel.com/index-test.html Instructions on it's usage
I have started using Simple-form and Bootstrap and I have tried to follow this
So I have tried to follow the alfresco example several times and cant seem
I have been trying to follow the instructions in the answer to this question
i have tried with these instructions available on this devoloper link I need to
I recently started using git. I tried to follow the instructions of setting my
I have tried unsuccessfully to copy the pwd to pbcopy as follows pwd |
Have tried to find solutions for this and can't really come up with anything.

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.