Quick {@link EntitySystem} retrieval.
6601
@SuppressWarnings("unchecked")
	public <T extends EntitySystem> T getSystem(Class<T> systemType) {
		return systemManager.getSystem(systemType);
	}
928743
private <E> E fetch(Class<E> entityClass, Key nativeKey) {
    try {
      Entity nativeEntity = nativeReader.get(nativeKey);
      E entity = Unmarshaller.unmarshal(nativeEntity, entityClass);
      entityManager.executeEntityListeners(CallbackType.POST_LOAD, entity);
      return entity;
    } catch (DatastoreException exp) {
      throw new EntityManagerException(exp);
    }
  }
20824
@Override
    public EntityIdentifier[] searchForEntities(String query, SearchMethod method, Class type)
            throws GroupsException {
        return new EntityIdentifier[0];
    }
1040574
private void storeEntityInformation(List<Chain> allChains, List<EntityInfo> entityInfos) {
		for (EntityInfo entityInfo : entityInfos) {
			String description = entityInfo.getDescription();
			String type;
			if (entityInfo.getType()==null){
				type = null;
			}
			else{
				type = entityInfo.getType().getEntityType();
			}
			List<Chain> entityChains = entityInfo.getChains();
			if (entityChains.isEmpty()){
				// Error mapping chain to entity
				System.err.println("ERROR MAPPING CHAIN TO ENTITY: "+description);
				mmtfDecoderInterface.setEntityInfo(new int[0], "", description, type);
				continue;
			}
			else{
				int[] chainIndices = new int[entityChains.size()];
				for (int i=0; i<entityChains.size(); i++) {
					chainIndices[i] = allChains.indexOf(entityChains.get(i));
				}
				Chain chain = entityChains.get(0);
				ChainImpl chainImpl;
				if (chain instanceof ChainImpl){
					chainImpl = (ChainImpl) entityChains.get(0);
				}
				else{
					throw new RuntimeException();
				}
				String sequence = chainImpl.getSeqResOneLetterSeq();
				mmtfDecoderInterface.setEntityInfo(chainIndices, sequence, description, type);
			}
		}
	}
33626
public static Map<Integer, Long> getSuspensionLevelsBySubsystem(EntityManager em, SubSystem subSystem) {
        return findBySubsystem(em, subSystem).getLevels();
    }
155973
public static synchronized List getPropertyNames(String entityTypeName) {
        if (entityTypeName == null) {
            return null;
        }
        if (!entityTypeName.equals("Entity")) {
            return (List) properties.get(entityTypeName);
        }
        if (propertyNames != null) {
            return propertyNames;
        } else {
            {
                List names = new ArrayList();
                names.add(PROP_IDENTIFIER);
                names.add(PROP_VIEW_IDENTIFIERS);
                names.add(PROP_PARENT);
                names.add(PROP_CHILDREN);
                names.add(PROP_GROUPS);
                names.add(PROP_CREATE_TIMESTAMP);
                names.add(PROP_MODIFY_TIMESTAMP);
                names.add(PROP_ENTITLEMENT_INFO);
                names.add(PROP_CHANGE_TYPE);
                propertyNames = Collections.unmodifiableList(names);
                return propertyNames;
            }
        }
    }
1318981
@PostMapping(value = "/{entityTypeId}", params = "_method=GET", produces = APPLICATION_JSON_VALUE)
  public EntityCollectionResponse retrieveEntityCollectionPost(
      @PathVariable("entityTypeId") String entityTypeId,
      @Valid @RequestBody EntityCollectionRequest request) {
    Set<String> attributesSet = toAttributeSet(request.getAttributes());
    Map<String, Set<String>> attributeExpandSet = toExpandMap(request.getExpand());

    return retrieveEntityCollectionInternal(
        entityTypeId, request, attributesSet, attributeExpandSet);
  }
872226
@GetMapping(value = "/{entityTypeId}/{id}/{refAttributeName}", produces = APPLICATION_JSON_VALUE)
  public Object retrieveEntityAttribute(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("id") String untypedId,
      @PathVariable("refAttributeName") String refAttributeName,
      @Valid EntityCollectionRequest request,
      @RequestParam(value = "attributes", required = false) String[] attributes,
      @RequestParam(value = "expand", required = false) String[] attributeExpands) {
    Set<String> attributesSet = toAttributeSet(attributes);
    Map<String, Set<String>> attributeExpandSet = toExpandMap(attributeExpands);

    return retrieveEntityAttributeInternal(
        entityTypeId, untypedId, refAttributeName, request, attributesSet, attributeExpandSet);
  }
11832
def _get_query_spec(cls, params):
    """"""
    entity_kind = params[cls.ENTITY_KIND_PARAM]
    filters = params.get(cls.FILTERS_PARAM)
    app = params.get(cls._APP_PARAM)
    ns = params.get(cls.NAMESPACE_PARAM)

    return model.QuerySpec(
        entity_kind=cls._get_raw_entity_kind(entity_kind),
        keys_only=bool(params.get(cls.KEYS_ONLY_PARAM, False)),
        filters=filters,
        batch_size=int(params.get(cls.BATCH_SIZE_PARAM, cls._BATCH_SIZE)),
        model_class_path=entity_kind,
        app=app,
        ns=ns)
1104116
@Override
    public List<EnhanceEntity> find(EntityMetadata m, List<String> relationNames, List<IndexClause> conditions,
        int maxResult, List<String> columns) {
        throw new UnsupportedOperationException("Support available only for thrift/pelops.");
    }
1036124
@PostMapping(
      value = "/{entityTypeId}/{id}/{refAttributeName}",
      params = "_method=GET",
      produces = APPLICATION_JSON_VALUE)
  public Object retrieveEntityAttributePost(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("id") String untypedId,
      @PathVariable("refAttributeName") String refAttributeName,
      @Valid @RequestBody EntityCollectionRequest request) {
    Set<String> attributesSet = toAttributeSet(request.getAttributes());
    Map<String, Set<String>> attributeExpandSet = toExpandMap(request.getExpand());

    return retrieveEntityAttributeInternal(
        entityTypeId, untypedId, refAttributeName, request, attributesSet, attributeExpandSet);
  }
1206784
@GetMapping(value = "/{entityTypeId}/meta", produces = APPLICATION_JSON_VALUE)
  public EntityTypeResponse retrieveEntityType(
      @PathVariable("entityTypeId") String entityTypeId,
      @RequestParam(value = "attributes", required = false) String[] attributes,
      @RequestParam(value = "expand", required = false) String[] attributeExpands) {
    Set<String> attributeSet = toAttributeSet(attributes);
    Map<String, Set<String>> attributeExpandSet = toExpandMap(attributeExpands);

    EntityType meta = dataService.getEntityType(entityTypeId);
    return new EntityTypeResponse(
        meta, attributeSet, attributeExpandSet, permissionService, dataService);
  }
475937
@GetMapping(value = "/{entityTypeId}/{id}", produces = APPLICATION_JSON_VALUE)
  public Map<String, Object> retrieveEntity(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("id") String untypedId,
      @RequestParam(value = "attributes", required = false) String[] attributes,
      @RequestParam(value = "expand", required = false) String[] attributeExpands) {
    Set<String> attributesSet = toAttributeSet(attributes);
    Map<String, Set<String>> attributeExpandSet = toExpandMap(attributeExpands);

    EntityType meta = dataService.getEntityType(entityTypeId);
    Object id = getTypedValue(untypedId, meta.getIdAttribute());
    Entity entity = dataService.findOneById(entityTypeId, id);
    if (entity == null) {
      throw new UnknownEntityException(meta, id);
    }

    return getEntityAsMap(entity, meta, attributesSet, attributeExpandSet);
  }
877842
private SQLQuery query(Class<?>... entity) {
		SQLQuery q = session.createSQLQuery(sql);
		if (entity.length == 1) {
			q.addEntity(entity[0]);
		}
		for (Map.Entry<String, Type> scalar : scalars.entrySet()) {
			q.addScalar(scalar.getKey(), scalar.getValue());
		}
		for (int i = 0; i < positionedParameters.length; i++) {
			q.setParameter(i, positionedParameters[i]);
		}
		for (Map.Entry<String, Object> entry : namedParameters.entrySet()) {
			Object value = entry.getValue();
			if (Types.isArray(value)) {
				Object[] parameter = (Object[]) value;
				if (parameter.length == 0) {
					throw new HibernateException(String.format("Invalid named parameter |%s|. Empty array.", entry.getKey()));
				}
				q.setParameterList(entry.getKey(), parameter);
			} else if (Types.isCollection(value)) {
				Collection<?> parameter = (Collection<?>) value;
				if (parameter.isEmpty()) {
					throw new HibernateException(String.format("Invalid named parameter |%s|. Empty list.", entry.getKey()));
				}
				q.setParameterList(entry.getKey(), parameter);
			} else {
				q.setParameter(entry.getKey(), value);
			}
		}
		if (offset > 0) {
			q.setFirstResult(offset);
		}
		if (rowsCount > 0) {
			q.setMaxResults(rowsCount);
		}
		return q;
	}
1021546
public List<EnhanceEntity> find(EntityMetadata m, List<String> relationNames, List<IndexClause> conditions,
            int maxResult, List<String> columns)
    {
        return (List<EnhanceEntity>) find(conditions, m, true, relationNames, maxResult, columns);
    }
1364682
def get_repository(self, entity_cls):
        """"""
        entity_record = self._get_entity_by_class(entity_cls)
        provider = self.get_provider(entity_record.provider_name)

        return provider.get_repository(entity_record.entity_cls)
1136966
@GET
	@Path("getEntities")
	public List<EntityMetaData> getEntities(@QueryParam("path") String path) {
		String absolutePath = StorageConstants.NEXT_SERVER_ROOT + path;
		List<EntityMetaData> result = new ArrayList<EntityMetaData>();
		Entity[] entities = new Entity[0];
		try {
			entities = storageService.getEntityChildren(absolutePath);
		} catch (NotFoundException e) {
			// TODO
			e.printStackTrace();
		}
		
		List<Entity> list = Arrays.asList(entities);
		Collections.sort(list, new Comparator<Entity>() {
			public int compare(Entity e1, Entity e2) {
				if (e1 instanceof Folder) {
					if (e2 instanceof Folder) {
						return Collator.getInstance().compare(e1.getName(), e2.getName());
					} else {
						return -1;
					}
				} else {
					if (e2 instanceof Folder) {
						return 1;
					} else {
						return Collator.getInstance().compare(e1.getName(), e2.getName());
					}
				}
			}
		});
		
		for (Entity entity : list) {
			result.add(createMetaData(entity));
		}
		
		return  result;
	}