这是我的情况
public boolean contains(Book book, Page needle){
for(com.googlecode.objectify.Key<Page> hay: book.getPages()){
if( needle.getKey().equals(hay) ) return true;
}
return false;
}
因此,基本上Book和Page是@Entity
s。本书包含一组页面,如List<Key<Page>>
。我需要查找给定书中是否存在某个页面。我如何比较按键?
您可以使用方法Key
从本机数据存储中获取。Key<>
Key<>.getRaw()
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句