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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:09:22+00:00 2026-06-09T05:09:22+00:00

Using DataNucleus, I have been happy using an abstract base class to provide a

  • 0

Using DataNucleus, I have been happy using an abstract base class to provide a ‘long’ ID to the sub-classes (please note the primitive type).

When adapting an example from JPA I got the idea to parameterize the base class. The purpose was to support different ID types, such as String.

@PersistenceCapable
@Inheritance(strategy=InheritanceStrategy.SUBCLASS_TABLE)
@Version(strategy=VersionStrategy.VERSION_NUMBER, column="jdo_version")
public abstract class VersionedIdEntity<P>
    implements Serializable {

  static final long serialVersionUID = 1L;

  @PrimaryKey
  @Persistent(valueStrategy=IdGeneratorStrategy.INCREMENT)
  private P id;

  public P getId() {
    return id;
  }
}

Generics made me use the wrapped Java type ‘Long’, so sub-classes were declared like this:

public class Account extends VersionedIdEntity<Long>

My switch to the new base class caused an error stating that no implementation for ‘java.lang.Object’ was found.

org.datanucleus.exceptions.NucleusUserException: Field “VersionedIdEntity.id” is declared as a reference type (interface/Object) but no implementation classes of “java.lang.Object” have been found!

Is the error related to type erasure?

Additional questions would be (1) how JPA deals with it and (2) whether I can restrict the type P to types persistable in DataNucleus, such as:

<? extends PersistableType>

While I could not find help elsewhere, the question could have been asked before. In that event, a brief pointer would be much appreciated.

  • 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-09T05:09:24+00:00Added an answer on June 9, 2026 at 5:09 am

    You mean does JDO define that an implementation should support this? Answer : no.
    JDO defines the valid PK types, and what is a “P” ? it is Object as far as a class is concerned (i.e (java.lang.)Object, since it doesn’t have the real type there). Neither does JPA define it for that matter.

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

Sidebar

Related Questions

I'm using the datastore of the Google App Engine (DataNucleus). I have two classes,
i am using gwt with jdo datanucleus. i have requirement to get child with
Consider having an application using DataNucleus with the following persistence structure: You have a
I'm using DataNucleus as a JPA implementation to store my classes in my web
I have doubt using jpa. I defined the datanucleus connection for MYSQL as follows.
I have 2 classes which get saved in the google datastore. class product which
Using boost python I need create nested namespace. Assume I have following cpp class
ANYONE using Datanucleus ( http://www.datanucleus.org/ ) with ECLIPSE RCP? Eclipse DOES NOT recognize Datanucleus
I am using DataNucleus' implement of JDO on a local H2 database. I want
I am using Datanucleus JDO on top of HSqlDb. I would like to execute

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.