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

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

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

Query.getObjectClass介绍

暂无

代码示例

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

private Object findCachedObject(UUID id, Query<?> query) {
  Object object = objectCache.getIfPresent(id);
  if (object == null && query.isReferenceOnly()) {
    object = referenceCache != null ? referenceCache.getIfPresent(id) : null;
  }
  if (object != null) {
    Class<?> objectClass = query.getObjectClass();
    if (objectClass != null && !objectClass.isInstance(object)) {
      object = null;
    }
  }
  return object;
}

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

private <T> List<T> createReplicationCacheObjects(List<T> objects, UUID typeId, UUID id, byte[] data, Map<String, Object> dataJson, Query<T> query) {
  if (typeId != null && query != null) {
    ObjectType type = ObjectType.getInstance(typeId);
    if (type != null) {
      Class<?> queryObjectClass = query.getObjectClass();
      if (queryObjectClass != null && !query.getObjectClass().isAssignableFrom(type.getObjectClass())) {
        return objects;
      }
      String queryGroup = query.getGroup();
      if (queryGroup != null && !type.getGroups().contains(queryGroup)) {
        return objects;
      }
    }
  }
  T object = createSavedObjectFromReplicationCache(id, data, dataJson, query);
  if (object != null) {
    if (objects == null) {
      objects = new ArrayList<>();
    }
    objects.add(object);
  }
  return objects;
}

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

/**
 * Returns all types that belong to this query's group in the given
 * {@code environment}. If this query was initialized with an object
 * class, the types that don't have backing Java classes are excluded.
 *
 * @param environment Can't be {@code null}.
 * @return Never {@code null}.
 */
public Set<ObjectType> getConcreteTypes(DatabaseEnvironment environment) {
  Set<ObjectType> types = environment.getTypesByGroup(getGroup());
  Class<?> queryObjectClass = getObjectClass();
  for (Iterator<ObjectType> i = types.iterator(); i.hasNext();) {
    ObjectType type = i.next();
    Class<?> typeObjectClass = type.getObjectClass();
    if (!type.isConcrete()) {
      i.remove();
    } else if (queryObjectClass != null
        && (typeObjectClass == null
        || !queryObjectClass.isAssignableFrom(typeObjectClass))) {
      i.remove();
    }
  }
  return types;
}

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

@Override
public void format(HtmlWriter writer) throws IOException {
  String objectClass = getObjectClass() != null ? getObjectClass().getName() : null;

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

private void formatQuery(HttpServletRequest request, HtmlWriter writer, Query<?> query) throws IOException {
  String objectClass = query.getObjectClass() != null ? query.getObjectClass().getName() : null;

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

Class<?> objectClass = query.getObjectClass();
List<Object> ids;

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

Class<?> objectClass = query.getObjectClass();
List<Object> ids;

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

Class queryObjectClass = query != null ? query.getObjectClass() : null;
    if (type != null && queryObjectClass != null && !query.getObjectClass().isAssignableFrom(type.getObjectClass())) {
      continue;
        if (type != null && queryObjectClass != null && !query.getObjectClass().isAssignableFrom(type.getObjectClass())) {
          continue;

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

@Override
public int hashCode() {
  return ObjectUtils.hashCode(
      getGroup(),
      getObjectClass(),
      getPredicate(),
      getSorters(),
      getDatabase(),
      getFields(),
      getOptions(),
      isResolveToReferenceOnly(),
      getTimeout());
}

相关文章