db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ranganath Chittari (JIRA)" <j...@apache.org>
Subject [jira] [Created] (JDO-726) Application Identity: org.datanucleus.exceptions.NucleusException: The key value passed to construct a SingleFieldIdentity of type "javax.jdo.identity.StringIdentity" for class should be String
Date Fri, 20 Dec 2013 09:48:09 GMT
Ranganath Chittari created JDO-726:
--------------------------------------

             Summary: Application Identity: org.datanucleus.exceptions.NucleusException: The
key value passed to construct a SingleFieldIdentity of type "javax.jdo.identity.StringIdentity"
for class should be String
                 Key: JDO-726
                 URL: https://issues.apache.org/jira/browse/JDO-726
             Project: JDO
          Issue Type: Bug
            Reporter: Ranganath Chittari
            Priority: Blocker


Hello I am trying with application identity for my Entity.
I have String column in my class which acts as primary key. It has annotation:
@Persistent(primaryKey = "true")
When I try to persist this entity, it throws the following exception:
org.datanucleus.exceptions.NucleusException: The key value passed to construct a SingleFieldIdentity
of type "javax.jdo.identity.StringIdentity" for class "com.wipro.wess.MOrganisation" is of
an incorrect type ("javax.jdo.identity.StringIdentity") - should be "String".
	at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:591)
	at org.datanucleus.api.jdo.JDOPersistenceManager.newObjectIdInstance(JDOPersistenceManager.java:1622)
	at org.datanucleus.api.jdo.JDOPersistenceManager.getObjectById(JDOPersistenceManager.java:1740)

I tried to resolve it by extending javax.jdo.identity.StringIdentity class by overriding the
method as below:
	public synchronized Object getKeyAsObject() {
		return (Object)this.orgId;
	}
But the same issue still persists. Please help me out on this issue

Thanks 
Ranganath



--
This message was sent by Atlassian JIRA
(v6.1.4#6159)

Mime
View raw message