0

I have a collection(arraylist) of Ref `s ,the objectify documentation says that I need to initialize collections for them to be persisted and hence modified in the future.....

Now , Ref points to an object but when I launch my app for the first time I dont have any objects in the data store...so whats the best way for me to initialize a dummy value...... Is my assumption that a Ref<> needs to point to a real object in the data store?

4

1 回答 1

0

两件事情:

  1. 您应该只初始化一个空集合。你不需要添加任何东西。例如,field = new ArrayList<Ref<Thing>>();
  2. 实际上甚至不需要初始化集合。这只是一个好主意,原因会在您使用该系统一段时间后变得显而易见。
于 2013-02-22T20:46:11.053 回答