我有以下实体:
public class Subscription {
@Id
String orderName;
.....
transient ArrayList<Long> plantsOrderIds;
int qty;
@Load
transient Ref<SubscriptionPlan> subscriptionPlan;
......
[Getters/ Setters]
........
}
我有这个函数来通过orderName获得Subscription。
public Subscription getSubscription(String orderName) {
return ofy().load().type(Subscription.class).id(orderName).safe();
}
Subscription sub = getSubscription("foo"); // returns the Subscription running locally, and throws NotFoundException when deployed on appengine.
我将函数更新为以下但仍然是相同的行为:
public Subscription getSubscription(String orderName) {
Key<Subscription> key = Key.create(Subscription.class, orderName);
return ofy().load().key(key).safe();
}
是什么原因引起了这个问题,或者我错过了什么?