@Override public boolean dropCluster(final String iClusterName, final boolean iTruncate) { checkIfActive(); final int clusterId = getClusterIdByName(iClusterName); OSchemaProxy schema = metadata.getSchema(); OClass clazz = schema.getClassByClusterId(clusterId); if (clazz != null) clazz.removeClusterId(clusterId); if (schema.getBlobClusters().contains(clusterId)) schema.removeBlobCluster(iClusterName); getLocalCache().freeCluster(clusterId); checkForClusterPermissions(iClusterName); return getStorage().dropCluster(iClusterName, iTruncate); }
@Override public boolean dropCluster(final int iClusterId, final boolean iTruncate) { checkIfActive(); checkSecurity(ORule.ResourceGeneric.CLUSTER, ORole.PERMISSION_DELETE, getClusterNameById(iClusterId)); OSchemaProxy schema = metadata.getSchema(); final OClass clazz = schema.getClassByClusterId(iClusterId); if (clazz != null) clazz.removeClusterId(iClusterId); getLocalCache().freeCluster(iClusterId); if (schema.getBlobClusters().contains(iClusterId)) schema.removeBlobCluster(getClusterNameById(iClusterId)); checkForClusterPermissions(getClusterNameById(iClusterId)); return getStorage().dropCluster(iClusterId, iTruncate); }
period.setParentModel(db.getMetadata().getSchema().getClassByClusterId(parent.getClusterId()).getName());
@Override public ILocation convertToEntity(ODocument document) { Location location = new Location(); location.setLongitude(document.field("longitude", Double.class)); location.setLatitude(document.field("latitude", Double.class)); location.setComment(document.field("comment", String.class)); // populate with data populateEntityWithBaseData(document, location); populateEntityWithCreatedModified(document, location); // parent ORecordId parent = document.field("parent", ORecordId.class); if (parent != null) { initDb(); location.setParentId(parent.getIdentity().toString()); location.setParentModel(db.getMetadata().getSchema().getClassByClusterId(parent.getClusterId()).getName()); //TODO: lazy load parent } // add distance, if set in document (added by some query results) if (document.field("$distance") != null) location.setDistance(document.field("$distance", Double.class)); return location; }