ObjectDB ObjectDB

"Unsupported auto value type java.lang.String" when persisting new instance

#1

I don't have a simple test case for this issue, but I'm getting this error:

Exception in thread "main" [ObjectDB 2.3.2] javax.persistence.PersistenceException
Unsupported auto value type java.lang.String for field hr.hzmo.network.model.Device.ID (error 323)
at com.objectdb.jpa.EMImpl.persist(EMImpl.java:378)
at hr.hzmo.network.database.NetworkInformationDatabase.main(NetworkInformationDatabase.java:71)
Caused by: com.objectdb.o.UserException: Unsupported auto value type java.lang.String for field hr.hzmo.network.model.Device.ID
at com.objectdb.o.MSG.d(MSG.java:61)
at com.objectdb.o.MDF.T(MDF.java:629)
at com.objectdb.o.ANM.ab(ANM.java:756)
at com.objectdb.o.ANT.W(ANT.java:981)
at com.objectdb.o.ANT.V(ANT.java:878)...

 

I check and every object has a different ID.

My annotations for primary key:


@Id

@GeneratedValue(strategy=GenerationType.IDENTITY)
private String ID;
edit
delete
#2

You cannot use @GeneratedValue for string Id only for numeric Ids.

Id fields whose type is string have to be assigned a value by the application.

ObjectDB Support
edit
delete

Reply

To post on this website please sign in.