我完全新的lagom框架,因此,我今天閱讀文檔,並開始修改自己的Hello World示例。如何獲取所有堅持實體
但是,我無法找到一個方法來獲取所有堅持實體(即所有堅持問候在這個例子中)。
這是默認的例子,如何獲取一個人的問候:
@Override
public ServiceCall<GreetingMessage, Done> useGreeting(String id) {
return request -> {
// Look up the hello world entity for the given ID.
PersistentEntityRef<HelloCommand> ref = persistentEntityRegistry.refFor(HelloWorld.class, id);
// Tell the entity to use the greeting message specified.
return ref.ask(new UseGreetingMessage(request.message));
};
}
現在,而不是使用一個給定的ID查找一個實體,我想獲取所有實體,例如像persistentEntityRegistry.getIds()
,然後我可以通過ID一個接一個地獲取它們。但是,這種方法似乎不存在於實體註冊表中?
非常感謝!這是一個很好的說明,因爲文檔起初可能有點誇張,特別是對於剛接觸框架的人來說。 – HyperZ
謝謝...請讓我們知道是否有任何方法可以改進文檔以使其更有用。 –