com.psddev.dari.db.Query.findById()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(182)

本文整理了Java中com.psddev.dari.db.Query.findById方法的一些代码示例,展示了Query.findById的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.findById方法的具体详情如下:
包路径:com.psddev.dari.db.Query
类名称:Query
方法名:findById

Query.findById介绍

[英]Finds an object of the given type matching the given id in the Database.Static#getDefault.
[中]在数据库中查找与给定id匹配的给定类型的对象。静态#获取默认值。

代码示例

代码示例来源:origin: perfectsense/brightspot-cms

@SuppressWarnings("all")
private <T> T resolveReference(Class<T> objectClass, Object reference) {
  if (reference instanceof Map) {
    return Query.findById(objectClass, ObjectUtils.to(UUID.class,
        ((Map<String, Object>) reference).get("_ref")));
  } else if (objectClass.isInstance(reference)) {
    return (T) reference;
  } else {
    return null;
  }
}

代码示例来源:origin: perfectsense/dari

public Object getObject() {
  Object value = getState().get(OBJECT_KEY);
  if (value == null) {
    value = object;
  }
  return value instanceof Record
      ? value
      : Query.findById(Object.class, StateValueUtils.toIdIfReference(value));
}

代码示例来源:origin: perfectsense/brightspot-cms

} else {
  UUID id = ObjectUtils.to(UUID.class, map.get("_id"));
  section = Query.findById(Object.class, id);
  if (section == null) {
    section = type.createObject(id);

代码示例来源:origin: perfectsense/brightspot-cms

ToolUser user = Query.findById(ToolUser.class, page.param(UUID.class, RemoteWidget.USER_ID_PARAMETER));

代码示例来源:origin: perfectsense/brightspot-cms

SearchResultSelection selection = Query.findById(SearchResultSelection.class, selectionId);
  ((SearchResultSelectionGeneratable) draftObject).fromSelection(Query.findById(SearchResultSelection.class, selectionId));

代码示例来源:origin: perfectsense/brightspot-cms

Section section = Query.findById(Section.class, sectionId);
if (section != null) {
  writeSection(request, response, response.getWriter(), section);

代码示例来源:origin: perfectsense/brightspot-cms

final SiteCategory siteCategory = siteCategoryId != null ? Query.findById(SiteCategory.class, siteCategoryId) : null;
final String queryString = page.param(String.class, "query");

代码示例来源:origin: perfectsense/brightspot-cms

Taxon parent = Query.findById(Taxon.class, taxonParentUuid);
Predicate filterPredicate = (site != null && predicate != null)
    ? CompoundPredicate.combine(PredicateParser.AND_OPERATOR, predicate, site.itemsPredicate())

代码示例来源:origin: perfectsense/brightspot-cms

UUID objectId = param(UUID.class, OBJECT_ID_PARAMETER);
Object object;
WorkStream workStream = Query.findById(WorkStream.class, param(UUID.class, "workStreamId"));

代码示例来源:origin: perfectsense/brightspot-cms

@Override
public void writeHtml(ToolPageContext page, Dashboard dashboard) throws IOException, ServletException {
  String type = page.pageParam(String.class, "type", null);
  final ObjectType itemType = Query.findById(ObjectType.class, page.pageParam(UUID.class, "itemType", null));
  long offset = page.param(long.class, "offset");
  int limit = page.pageParam(Integer.class, "limit", 20);

代码示例来源:origin: perfectsense/brightspot-cms

@Override
@SuppressWarnings("deprecation")
protected void doService(final ToolPageContext page) throws IOException, ServletException {
  Page mainObject = Query.findById(Page.class, page.param(UUID.class, "id"));

代码示例来源:origin: perfectsense/brightspot-cms

@Override
@SuppressWarnings("deprecation")
public void writeHtml(ToolPageContext page, Dashboard dashboard) throws IOException, ServletException {
  ObjectType itemType = Query.findById(ObjectType.class, page.pageParam(UUID.class, "itemType", null));
  Type type = page.pageParam(Type.class, "type", Type.ANYONE);
  String valueParameter = type + ".value";

代码示例来源:origin: perfectsense/brightspot-cms

@Override
protected void doService(final ToolPageContext page) throws IOException, ServletException {
  Object obj = Query.findById(Object.class, page.param(UUID.class, "objectId"));
  State state = State.getInstance(obj);
  Workflow workflow = Workflow.findWorkflow(state.as(Site.ObjectModification.class).getOwner(), state);

相关文章