Google App Engine java用objectify替换jpa @ OneToMany/@ ManyToOne

Ram*_*h V 5 java google-app-engine objectify

我有一个现有的谷歌应用程序引擎java应用程序与jpa运行,现在我试图为了许多不同的目的移动到物镜化.

当前的申请具有以下实体的表示.

Class Parent{
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Key key;

    @OneToMany(cascade=CascadeType.ALL, mappedBy="parent")
    private List<Child> childs = null;
}

Class Child{
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Key key;

    @ManyToOne  
    private Parent parent;

}
Run Code Online (Sandbox Code Playgroud)

我怎样才能在Objectify中获得上述表示?我正在使用objectify4.
我见过@Parent,但是在获取父项时似乎无法直接加载子实体列表?

谢谢,

Ramesh.V

Ram*_*h V 1

我为自己的问题找到了解决方案。这是代码。

https://github.com/rameshv1210/objectify-many-to-one/