FetchOptions.Builder.withOffset(0));
List<String> propNameList = Lists.newArrayList();
for (Entity _kind : _list) {
if (_kind.getProperty("kind_name").equals(kind)) {
String propName = (String) _kind.getProperty("property_name");
GbProperty gbProperty = new GbProperty();
gbProperty.setName(propName);
// Different type and same name properties are returned in
// production! and here comparing only property_name.
if (propNameList.contains(propName) == false) {
list.add(gbProperty);
propNameList.add(propName);
}
}
}
} else {
Schema schema = DatastoreUtil.getSchema();
List<EntityProto> entityProtoList = schema.kinds();
EntityProto targetEntity = null;
for (EntityProto entityProto : entityProtoList) {
String kindName = DatastoreUtil.getKind(entityProto.getKey());
if (kind.equals(kindName)) {
targetEntity = entityProto;
break;
}
}
if (targetEntity == null) {
throw new RuntimeException("The specified kind has no property");
}
List<Property> propertys = targetEntity.propertys();
for (Property property : propertys) {
GbProperty gbProperty = new GbProperty();
gbProperty.setName(property.getName());
list.add(gbProperty);
}
}
logger.fine(list.toString());