Skip to content

Instantly share code, notes, and snippets.

@shin1ogawa
Created May 14, 2009 10:09
Show Gist options
  • Save shin1ogawa/111599 to your computer and use it in GitHub Desktop.
Save shin1ogawa/111599 to your computer and use it in GitHub Desktop.
import java.util.ArrayList;
import java.util.List;
import javax.jdo.annotations.Extension;
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;
import com.google.appengine.api.datastore.Key;
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Parent2 {
/** 主キー */
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@Extension(vendorName = "datanucleus", key = "gae.encoded-pk", value = "true")
private String key;
/** 主キーの{@link Key#getId()}の値 */
@Persistent
@Extension(vendorName = "datanucleus", key = "gae.pk-id", value = "true")
private Long id;
@Persistent
private List<Child2> children = new ArrayList<Child2>(0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment