@Override public EntityInfo getEntityInfo(String entityName) { if (entityName == null || entityName.length() == 0) { throw new IllegalArgumentException(LITERAL_ENTITY_NAME); } Error.push("getEntityInfo(" + entityName + ")"); try { BasicDBObject query = new BasicDBObject(LITERAL_ID, entityName + BSONParser.DELIMITER_ID); DBObject ei = new FindOneCommand(collection, query).executeAndUnwrap(); if (ei != null) { return mdParser.parseEntityInfo(ei); } else { return null; } } catch (Error e) { // rethrow lightblue error throw e; } catch (Exception e) { throw analyzeException(e, MetadataConstants.ERR_ILL_FORMED_METADATA); } finally { Error.pop(); } }
LOGGER.debug("Checking if there are entity versions that are not disabled: {}", query); DBObject result = new FindOneCommand(collection, query).executeAndUnwrap(); if (result != null) { LOGGER.debug("There is at least one enabled version {}", result);
DBObject es = new FindOneCommand(collection, query).executeAndUnwrap(); if (es != null) { schema = mdParser.parseEntitySchema(es);
Error.push("setMetadataStatus(" + entityName + ":" + version + ")"); try { DBObject md = new FindOneCommand(collection, query).executeAndUnwrap(); if (md == null) { throw Error.get(MongoMetadataConstants.ERR_UNKNOWN_VERSION, entityName + ":" + version);
DBObject ei = new FindOneCommand(collection, query).executeAndUnwrap(); String defaultVersion = ei == null ? null : (String) ei.get("defaultVersion");
DBObject lookupq=getLookupQ(identityFields,identityFieldValues); LOGGER.debug("Lookup query: {}",lookupq); oldDBObject=new FindOneCommand(collection,lookupq).executeAndUnwrap(); LOGGER.debug("Retrieved:{}",oldDBObject); if(oldDBObject!=null) BasicDBObject q = new BasicDBObject(MongoCRUDController.ID_STR, Translator.createIdFrom(id)); if(oldDBObject==null) { oldDBObject = new FindOneCommand(collection, q).executeAndUnwrap();