Error with org.springframework.data.jpa.domain.AbstractPersistable

#1

I am working on a Spring Boot application. I want to integrate ObjectDB with Spring Data JPA.

I refer to the http://www.objectdb.com/database/forum/860 to do the configuration. When I start up my application, I got below error. It seems like ObjectDB does not support a generic @ID in the super class. Is this a bug in the ObjectDB? It was totally fine when working with Hibernate or EclipseLink.

Caused by: com.objectdb.o.UserException: Unsupported auto value type java.io.Serializable for field org.springframework.data.jpa.domain.AbstractPersistable.id
at com.objectdb.o.MSG.d(MSG.java:62)
at com.objectdb.o.MDF.T(MDF.java:640)
at com.objectdb.o.ANM.ac(ANM.java:761)
at com.objectdb.o.ANT.W(ANT.java:982)
at com.objectdb.o.ANT.V(ANT.java:879)
at com.objectdb.o.SCM.r(SCM.java:305)
at com.objectdb.o.SCM.r(SCM.java:208)
at com.objectdb.o.SCM.r(SCM.java:208)
at com.objectdb.o.TYS.n(TYS.java:294)
at com.objectdb.o.TYM.ae(TYM.java:521)
at com.objectdb.o.TYM.ac(TYM.java:467)
at com.objectdb.o.TYM.ao(TYM.java:788)
at com.objectdb.jpa.MetamodelImpl.obtainType(MetamodelImpl.java:269)
at com.objectdb.jpa.MetamodelImpl.managedType(MetamodelImpl.java:149)
... 53 more

 

 

 

 

#2

This exception can be reproduced by the following simple console application (i.e. without Spring Boot):

import java.io.*;

import javax.persistence.*;


public final class T1545
{
    public static void main(String[] args) {

        EntityManagerFactory emf =
            Persistence.createEntityManagerFactory(
                "objectdb:$objectdb/db/test.tmp;drop");
        EntityManager em = emf.createEntityManager();

        em.getTransaction().begin();
        em.persist(new MyEntity());
        em.getTransaction().commit();

        em.close();
        emf.close();
    }

    @MappedSuperclass
    public static class AbstractPersistable<PK extends Serializable>
    {
        @Id @GeneratedValue
        PK id;
    }

    @Entity   
    public static class MyEntity extends AbstractPersistable<Long>
    {
    }
}

Seems that currently ObjectDB does not support a field of generic type (although parameterized) as a primary key. We will check if this ability can be added easily.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login