@Override @GraphTransaction public ITypedReferenceableInstance getEntityDefinition(String guid) throws RepositoryException, EntityNotFoundException { LOG.debug("Retrieving entity with guid={}", guid); Vertex instanceVertex = graphHelper.getVertexForGUID(guid); try { return graphToInstanceMapper.mapGraphToTypedInstance(guid, instanceVertex); } catch (AtlasException e) { throw new RepositoryException(e); } }
@Override @GraphTransaction public ITypedReferenceableInstance getEntityDefinition( String entityType, String attribute, Object value) throws AtlasException { LOG.debug("Retrieving entity with type={} and {}={}", entityType, attribute, value); IDataType type = typeSystem.getDataType(IDataType.class, entityType); String propertyKey = getFieldNameInVertex(type, attribute); Vertex instanceVertex = graphHelper.findVertex( propertyKey, value, Constants.ENTITY_TYPE_PROPERTY_KEY, entityType, Constants.STATE_PROPERTY_KEY, Id.EntityState.ACTIVE.name()); String guid = instanceVertex.getProperty(Constants.GUID_PROPERTY_KEY); return graphToInstanceMapper.mapGraphToTypedInstance(guid, instanceVertex); }