<p>
Find a record by id.
</p>

@param cls The model class.
@param id  The model Id.
@return The query result.
171967
public static final <T extends Model> T find(Class<T> cls, Long id) {
		return Select.from(cls).where(_ID + "=?", id).fetchSingle();
	}
437896
@Override
	public Iterable<T> findAllById(final Iterable<ID> ids) {
		return arangoOperations.find(ids, domainClass);
	}
14891
public K find(final V id) {
        final V keyValue = keyForValue(id);
        
        if (inverse.containsKey(keyValue)) {
            return inverse.get(keyValue);
        }
        
        if (log.isDebugEnabled()) {
        	log.debug("Enum with value " + id + " not found");
        }
        
        return null;
    }
364813
def by_id(cls, _id, engine_or_session):
        
        ses, auto_close = ensure_session(engine_or_session)
        obj = ses.query(cls).get(_id)
        if auto_close:
            ses.close()
        return obj
478525
public static Method findMethod(Method methodToFind, Class<?> cls) {
        if (cls == null) {
            return null;
        }
        String methodToSearch = methodToFind.getName();
        Class<?>[] soughtForParameterType = methodToFind.getParameterTypes();
        Type[] soughtForGenericParameterType = methodToFind.getGenericParameterTypes();
        for (Method method : cls.getMethods()) {
            if (method.getName().equals(methodToSearch) && method.getReturnType().isAssignableFrom(methodToFind.getReturnType())) {
                Class<?>[] srcParameterTypes = method.getParameterTypes();
                Type[] srcGenericParameterTypes = method.getGenericParameterTypes();
                if (soughtForParameterType.length == srcParameterTypes.length &&
                    soughtForGenericParameterType.length == srcGenericParameterTypes.length) {
                    if (hasIdenticalParameters(srcParameterTypes, soughtForParameterType, srcGenericParameterTypes, soughtForGenericParameterType)) {
                        return method;
                    }
                }
            }
        }
        return null;
    }
190299
public Object find(Class entityClass, Object key)
    {

        EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata, entityClass);

        String tableName = entityMetadata.getTableName();
        Class fieldClass = entityMetadata.getIdAttribute().getJavaType();
        String select_Query = SparkQueryConstants.SELECTALL_QUERY;
        select_Query = StringUtils.replace(select_Query, SparkQueryConstants.TABLE, tableName);
        StringBuilder builder = new StringBuilder(select_Query);
        builder.append(SparkQueryConstants.ADD_WHERE_CLAUSE);
        builder.append(dataHandler.getColumnName(entityMetadata.getIdAttribute()));
        builder.append(SparkQueryConstants.EQUALS);

        appendValue(builder, fieldClass, key);
        List result = this.executeQuery(builder.toString(), entityMetadata, null);
        return result.isEmpty() ? null : result.get(0);
    }
636629
public DesignDocument get(String id) {
        assertNotEmpty(id, "id");
        return db.find(DesignDocument.class, ensureDesignPrefix(id));
    }
294341
private <T> T read_(Class<T> clazz, Object id) {
		Map<String, Object> objects = objects(clazz);
		return (T) objects.get(id.toString());
	}
792327
def find(cls, _id):
        

        if not _id:
            return None
        try:
            return next(cls.where(id=_id))
        except StopIteration:
            raise PanoptesAPIException(
                "Could not find {} with id='{}'".format(cls.__name__, _id)
            )
521427
def find_model_by_id(self, constructor, id_, *, columns=None):
    
    return self.find_model(
      constructor, get_id_constraints(constructor.primary_key_name, id_), columns=columns)
434355
private final Object find(Class<?> clazz, EntityMetadata metadata, Object rowId, List<String> relationNames) {

        List<Object> result = null;
        try {
            MetamodelImpl metaModel =
                (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(metadata.getPersistenceUnit());

            EntityType entityType = metaModel.entity(clazz);

            List<ManagedType> subTypes = ((AbstractManagedType) entityType).getSubManagedType();

            if (!subTypes.isEmpty()) {
                for (ManagedType subEntity : subTypes) {
                    EntityMetadata subEntityMetadata =
                        KunderaMetadataManager.getEntityMetadata(kunderaMetadata, subEntity.getJavaType());
                    result = populate(clazz, subEntityMetadata, rowId, subEntityMetadata.getRelationNames(), metaModel);
                    if (result != null && !result.isEmpty()) {
                        break;
                    }
                }
            } else {
                result = populate(clazz, metadata, rowId, relationNames, metaModel);
            }
        } catch (Exception e) {
            log.error("Error while retrieving records from database for entity {} and key {}, Caused by: .", clazz,
                rowId, e);

            throw new PersistenceException(e);
        }

        return result != null && !result.isEmpty() ? result.get(0) : null;
    }
392681
@SuppressWarnings({ "rawtypes", "unchecked" })
	public <T> T get(Class clazz, Object id) throws NoIdAnnotationFoundException, NoColumnAnnotationFoundException {
		
		//turn class to sql
		SqlParamsPairs sqlAndParams = ModelSqlUtils.getGetFromObject(clazz, id);
		
		//query for list
		List<T> list = this.list(sqlAndParams.getSql(), sqlAndParams.getParams(), clazz);
		if (list.size() > 0) {
			return list.get(0);
		} else {
			return null;
		}
	}
429629
@SuppressWarnings("unchecked")
    public <T> T get(Class<T> cls) {
        T runtimeInstance = (T) runtimeServices.computeIfAbsent(cls, this::createRuntimeInstance);
        if (runtimeInstance == null) {
            throw new NoSuchElementException(cls.getName());
        } else {
            return runtimeInstance;
        }
    }
863787
public Object find(Class clazz, Object identifier) {
        try {
            return persistenceManager.findById(clazz, identifier);
        } catch (InitializationException ignore){}
        catch (Exception e) {
            e.printStackTrace();
        }

        return null;
    }
769565
private <T> Class<? extends T> getObjectFromClassMap(String id, Map<String, Object> classMap)
    {
        Object obj = classMap.get(id);
        
        if(obj == null)
        {
            return null;    //object for this id wasn't found on the map
        }
        
        if(obj instanceof Class<?>)
        {
            return (Class<? extends T>)obj;
        }
        else if (obj instanceof String )
        {
            Class<?> clazz = ClassUtils.simpleClassForName((String)obj);
            classMap.put(id, clazz);
            return (Class<? extends T>)clazz;
        }
        
        //object stored in the map for this id is an invalid type.  remove it and return null
        classMap.remove(id);
        return null;        
    }
367210
public Object newInstanceWithId(final Object id)
	{
		try
		{
			final Object o = clazz.newInstance();

			idProperty.set(o, id);

			return o;
		}
		catch (Throwable e)
		{
			throw new RuntimeException("Cannot create new instance of " +
			                           clazz +
			                           " with ID " +
			                           id +
			                           " (of type " +
			                           id.getClass() +
			                           ") populated!", e);
		}
	}
219308
@Override
	public ZooClass getClass(Class<?> cls) {
		DBTracer.logCall(this, cls);
		checkValidityRead();
		return sm.locateSchema(cls, null);
	}