com.tcdng.unify.core.database.Query.<init>()方法的使用及代码示例

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

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

Query.<init>介绍

暂无

代码示例

代码示例来源:origin: com.tcdng.unify/unify-core

@SuppressWarnings({ "unchecked", "rawtypes" })
public Query<T> copyNoCriteria() {
  Query<T> query = new Query(entityClass, applyAppQueryLimit);
  query.select = select;
  query.order = order;
  query.offset = offset;
  query.limit = limit;
  query.ignoreEmptyCriteria = ignoreEmptyCriteria;
  query.mustMatch = mustMatch;
  return query;
}

代码示例来源:origin: com.tcdng.unify/unify-core

@SuppressWarnings({ "unchecked", "rawtypes" })
public Query<T> copy() {
  Query<T> query = new Query(entityClass, applyAppQueryLimit);
  query.andBuilder = andBuilder;
  query.select = select;
  query.order = order;
  query.offset = offset;
  query.limit = limit;
  query.ignoreEmptyCriteria = ignoreEmptyCriteria;
  query.mustMatch = mustMatch;
  return query;
}

代码示例来源:origin: com.tcdng.unify/unify-core

@SuppressWarnings({ "unchecked", "rawtypes" })
public Query<T> copyNoAll() {
  return new Query(entityClass, applyAppQueryLimit);
}

代码示例来源:origin: com.tcdng.unify/unify-core

@Override
public <T extends Entity> T find(Class<T> clazz, Object id) throws UnifyException {
  Query<T> query = new Query<T>(clazz);
  query.equals("id", id);
  return (T) db().list(query);
}

代码示例来源:origin: com.tcdng.unify/unify-core

@Override
public <T, U extends Entity> T listValue(Class<T> valueClazz, Class<U> recordClazz, Object id, String property)
    throws UnifyException {
  return db().value(valueClazz, property, new Query<U>(recordClazz).equals("id", id));
}

代码示例来源:origin: com.tcdng.unify/unify-core

@SuppressWarnings({ "unchecked", "rawtypes" })
private void deleteChildRecords(SqlEntityInfo sqlEntityInfo, Object id) throws UnifyException {
  for (OnDeleteCascadeInfo odci : sqlEntityInfo.getOnDeleteCascadeInfoList()) {
    Query<? extends Entity> query = new Query(odci.getChildEntityClass());
    query.equals(odci.getChildFkField().getName(), id);
    deleteAll(query);
  }
}

代码示例来源:origin: com.tcdng.unify/unify-core

@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public List<? extends Listable> execute(Locale locale, SearchProviderParams params) throws UnifyException {
  String key = params.getKey();
  if (!StringUtils.isBlank(key)) {
    return genericService.listAll(new Query(recordType).equals(keyProperty, key).limit(searchLimit));
  }
  String filter = params.getFilter();
  if (!StringUtils.isBlank(filter)) {
    return genericService.listAll(new Query(recordType).like(descProperty, filter).limit(searchLimit));
  }
  return Collections.emptyList();
}

代码示例来源:origin: com.tcdng.unify/unify-core

@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public <T extends Entity> T findConstraint(T record) throws UnifyException {
  SqlEntityInfo sqlEntityInfo = sqlDataSourceDialect.getSqlEntityInfo(record.getClass());
  if (sqlEntityInfo.isUniqueConstraints()) {
    Query<T> query = new Query(record.getClass());
    for (SqlUniqueConstraintInfo suci : sqlEntityInfo.getUniqueConstraintList().values()) {
      query.clear();
      for (String fieldName : suci.getFieldNameList()) {
        query.equals(fieldName, ReflectUtils.getBeanProperty(record, fieldName));
      }
      T constrainingRecord = find(query);
      if (constrainingRecord != null) {
        return constrainingRecord;
      }
    }
  }
  return null;
}

代码示例来源:origin: com.tcdng.unify/unify-web

Query<? extends Entity> criteria = new Query(validationClazz);
String idProperty = getUplAttribute(String.class, "idProperty");
Object id = getTransferValue(idClazz, idProperty, dataTransfer);

代码示例来源:origin: com.tcdng.unify/unify-core

Query<? extends Entity> query = new Query(clfi.getChildEntityClass());
query.equals(clfi.getChildFkField().getName(), id).order("id");
List<? extends Entity> childList = null;
Query<? extends Entity> query = new Query(clfi.getChildEntityClass());
query.equals(clfi.getChildFkField().getName(), id).order("id");
List<? extends Entity> childList = null;

代码示例来源:origin: com.tcdng.unify/unify-core

@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public int count(Query<? extends Entity> query) throws UnifyException {
  try {
    SqlEntityInfo sqlEntityInfo = sqlDataSourceDialect.getSqlEntityInfo(query.getEntityClass());
    if (sqlEntityInfo.testTrueFieldNamesOnly(query.getFields())) {
      return getSqlStatementExecutor().executeSingleObjectResultQuery(connection, int.class,
          sqlDataSourceDialect.getSqlTypePolicy(int.class),
          sqlDataSourceDialect.prepareCountStatement(query), true);
    }
    SqlFieldInfo idFieldInfo = sqlEntityInfo.getIdFieldInfo();
    List<?> idList = valueList(idFieldInfo.getFieldType(), idFieldInfo.getName(), query);
    if (!idList.isEmpty()) {
      Query<? extends Entity> countQuery = new Query(query.getEntityClass(), query.isApplyAppQueryLimit());
      countQuery.add(new Amongst(idFieldInfo.getName(), idList));
      return getSqlStatementExecutor().executeSingleObjectResultQuery(connection, int.class,
          sqlDataSourceDialect.getSqlTypePolicy(int.class),
          sqlDataSourceDialect.prepareCountStatement(countQuery), true);
    }
  } catch (UnifyException e) {
    throw e;
  } catch (Exception e) {
    throw new UnifyException(e, UnifyCoreErrorConstants.COMPONENT_OPERATION_ERROR, getClass().getSimpleName());
  }
  return 0;
}

代码示例来源:origin: com.tcdng.unify/unify-core

if (sqlEntityInfo.isOnDeleteCascadeList()) {
  for (OnDeleteCascadeInfo odci : sqlEntityInfo.getOnDeleteCascadeInfoList()) {
    Query<? extends Entity> attrQuery = new Query(odci.getChildEntityClass());
    attrQuery.amongst(odci.getChildFkField().getName(), idList);
    deleteAll(attrQuery);

相关文章