public static Schema getSchema() throws IllegalStateException {
if (AppEngineUtil.isProduction()) {
throw new IllegalStateException(
"This method does not work on production server.");
}
GetSchemaRequest req = new GetSchemaRequest();
req.setApp(ApiProxy.getCurrentEnvironment().getAppId());
byte[] resBuf =
ApiProxy.makeSyncCall(DATASTORE_SERVICE, GET_SCHEMA_METHOD, req
.toByteArray());
Schema schema = new Schema();
schema.mergeFrom(resBuf);
return schema;
}