我的android后端设置了一个数据存储区,当我尝试使用这些说明时:
Entity tour = new Entity("tour", tourKey);
tour.setProperty("date", "<b>Date:</b><br> Venerdì 07 maggio 2015, ore 20:30 <br> Giovedì 21 maggio 2015, ore 20:30\"");
tour.setProperty("durata", "<b>Durata:</b><br>Circa 1 ora e ½");;
Object order = new Integer(1);
tour.setProperty("order",order);
然后使用以下命令查询:
List<Entity> tourss = datastore.prepare(query).asList(FetchOptions.Builder.withDefaults());
Query query = new Query("tour").setAncestor(tourKey).addSort("order");
for (Entity t : tourss) {
String date=t.getProperty("date").toString();
String durata=t.getProperty("durata").toString();
Object ordine = t.getProperty("order"); // ???
值ordine
始终是String
,为什么?如何归还integer
?
PS。铸造不起作用