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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:53:16+00:00 2026-06-12T02:53:16+00:00

I have class which has Map, but when I try to presist this entity,

  • 0

I have class which has Map, but when I try to presist this entity, throws null pointer exception. What could be wrong in my code/settings?

My class:

@PersistenceCapable(detachable="true")
public class MyClassEntity implements MyClass {

    @PrimaryKey
    @Persistent(valueStrategy=IdGeneratorStrategy.NATIVE)
    private String id;

    @Persistent @Join @Element(embedded="true")
    @Extension(vendorName = "datanucleus", key = "implementation-classes", value = "com.company.MySecondClassEntity")
    private Map<String, MySecondClass> map = new HashMap<String, MySecondClass>();

    // Getters and setters here

}

Exception:

Exception in thread "main" java.lang.NullPointerException
    at org.datanucleus.store.rdbms.sql.AbstractStatementGenerator.<init>(AbstractStatementGenerator.java:101)
    at org.datanucleus.store.rdbms.sql.AbstractStatementGenerator.<init>(AbstractStatementGenerator.java:139)
    at org.datanucleus.store.rdbms.sql.UnionStatementGenerator.<init>(UnionStatementGenerator.java:153)
    at org.datanucleus.store.rdbms.scostore.RDBMSJoinMapStore.getSQLStatementForGet(RDBMSJoinMapStore.java:770)
    at org.datanucleus.store.rdbms.scostore.RDBMSJoinMapStore.getValue(RDBMSJoinMapStore.java:639)
    at org.datanucleus.store.rdbms.scostore.RDBMSJoinMapStore.putAll(RDBMSJoinMapStore.java:195)
    at org.datanucleus.store.mapped.mapping.MapMapping.postInsert(MapMapping.java:135)
    at org.datanucleus.store.rdbms.request.InsertRequest.execute(InsertRequest.java:520)
    at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.insertTable(RDBMSPersistenceHandler.java:166)
    at org.datanucleus.store.rdbms.RDBMSPersistenceHandler.insertObject(RDBMSPersistenceHandler.java:142)
    at org.datanucleus.state.JDOStateManager.internalMakePersistent(JDOStateManager.java:2377)
    at org.datanucleus.state.JDOStateManager.makePersistent(JDOStateManager.java:2353)
    at org.datanucleus.ObjectManagerImpl.persistObjectInternal(ObjectManagerImpl.java:1896)
    at org.datanucleus.ObjectManagerImpl.persistObjectWork(ObjectManagerImpl.java:1745)
    at org.datanucleus.ObjectManagerImpl.persistObject(ObjectManagerImpl.java:1593)
    at org.datanucleus.api.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:731)
    at org.datanucleus.api.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:756)
    at com.mycompany.dao.impl.JDOGenericDao.save(JDOGenericDao.java:63)
    at com.mycompany.dao.Main.main(Main.java:29)

Maven dependecies:

 <dependencies>
    <dependency>
        <groupId>org.datanucleus</groupId>
        <artifactId>datanucleus-core</artifactId>
        <version>3.1.2</version>
    </dependency>
    <dependency>
        <groupId>org.datanucleus</groupId>
        <artifactId>datanucleus-api-jdo</artifactId>
        <version>3.1.2</version>
    </dependency>
    <dependency>
        <groupId>javax.jdo</groupId>
        <artifactId>jdo-api</artifactId>
        <version>3.0.1</version>
    </dependency>
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>[1.2, 1.3)</version>
    </dependency>
    <dependency>
        <groupId>org.datanucleus</groupId>
        <artifactId>datanucleus-rdbms</artifactId>
        <version>3.1.2</version>
    </dependency>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.21</version>
    </dependency>
</dependencies>
  • 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-12T02:53:18+00:00Added an answer on June 12, 2026 at 2:53 am

    Would have thought that “value-implementation-classes” as an extension key makes way more sense than what you have there (otherwise how is it to know that you are talking about the values of the map and not the keys?)

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

Sidebar

Related Questions

I have a class which has implemented INotifyPropertyChanged . This class UserInfo has a
I have an unmanaged C++ class which has a com map inside of it.
I have a class which has a function to retrieve children elements from a
I have a class which has a private attribute which is a reference to
I have a class which has a private attribute vector rectVec; class A {
I have a class which has two HashSet<String> collections as private members. Other classes
I have a class which has functionality to initialise opengl and run it in
I have a class which has a variety of details, as follows: Vehicle Name
Imagine you have class A which has code which runs as method M. And
Suppose I have some class which has a property actor_ of type Actor .

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.