Google App Engine JDO error caused by GregorianCalendar?
My class looks like this :
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
@PersistenceCapable(identityType=IdentityType.APPLICATION)
public class Contact_Info implements Serializable
{
@PrimaryKey
@Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
Long Id;
public static final long serialVersionUID=26362862L;
@Persistent
String Contact_Id="";
@Persistent
GregorianCalendar Date_1;
public Contact_Info() { }
public void setId(Long value) { Id=value; }
public Long getId()开发者_运维百科 { return Id; }
public void setContact_Id(String value) { Contact_Id=value; }
public String getContact_Id() { return Contact_Id; }
public void setDate_1(GregorianCalendar value) { Date_1=value; }
public GregorianCalendar getDate_1() { return Date_1; }
public String toString() { return Contact_Id; }
}
When it's run, I got the following error :
java.lang.UnsupportedOperationException org.datanucleus.store.appengine.EntityUtils.getPropertyName(EntityUtils.java:62) org.datanucleus.store.appengine.DatastoreFieldManager.storeObjectField(DatastoreFieldManager.java:839) org.datanucleus.state.AbstractStateManager.providedObjectField(AbstractStateManager.java:1037) PayPal_Monitor.Contact_Info.jdoProvideField(Contact_Info.java) PayPal_Monitor.Contact_Info.jdoProvideFields(Contact_Info.java) org.datanucleus.state.JDOStateManagerImpl.provideFields(JDOStateManagerImpl.java:2715) org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPreProcess(DatastorePersistenceHandler.java:341) org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects(DatastorePersistenceHandler.java:251)
If I take out the "GregorianCalendar Date_1", it works correctly, what should I do to fix it ? I do need the date in it.
Frank
There's an open issue for it but what I don't really understand is that it was supposedly fixed a year ago. I've bumped the bug, I'll edit back my answer if something happens.
精彩评论