由GregorianCalendar引起的Google App Engine JDO错误?

时间:2010-04-26 17:30:04

标签: google-app-engine jdo gregorian-calendar

我的班级看起来像这样:

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; }
}

当它运行时,我收到以下错误:

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)

如果我拿出“GregorianCalendar Date_1”,它可以正常工作,我该怎么做才能修复它?我确实需要它的日期。

1 个答案:

答案 0 :(得分:0)

它有一个open issue,但我真正理解的是它一年前应该是fixed。我已经碰到了这个错误,如果发生了什么事,我会回复我的答案。