com.avaje.ebean.Query.select()方法的使用及代码示例

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

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

Query.select介绍

[英]Explicitly set a comma delimited list of the properties to fetch on the 'main' entity bean (aka partial object). Note that '*' means all properties.

Query<Customer> query = Ebean.createQuery(Customer.class); 
// Only fetch the customer id, name and status. 
// This is described as a "Partial Object" 
query.select("name, status"); 
query.where("lower(name) like :custname").setParameter("custname", "rob%"); 
List<Customer> customerList = query.findList();

[中]显式设置一个逗号分隔的属性列表,以便在“main”实体bean(又称部分对象)上获取。请注意,“*”表示所有属性

Query<Customer> query = Ebean.createQuery(Customer.class); 
// Only fetch the customer id, name and status. 
// This is described as a "Partial Object" 
query.select("name, status"); 
query.where("lower(name) like :custname").setParameter("custname", "rob%"); 
List<Customer> customerList = query.findList();

代码示例

代码示例来源:origin: org.actframework/act-ebean-java7

@Override
public EbeanQuery<MODEL_TYPE> select(String fetchProperties) {
  q.select(fetchProperties);
  qReadOnly.select(fetchProperties);
  return this;
}

代码示例来源:origin: org.avaje.ebean/ebean

@Override
public Query<T> select(String fetchProperties) {
 return query.select(fetchProperties);
}

代码示例来源:origin: org.avaje.ebeanorm/avaje-ebeanorm-server

public Query<T> select(String fetchProperties) {
 return query.select(fetchProperties);
}

代码示例来源:origin: org.avaje/ebean

public Query<T> select(String fetchProperties) {
 return query.select(fetchProperties);
}

代码示例来源:origin: com.typesafe.play/play-java-ebean

/**
 * Explicitly sets a comma delimited list of the properties to fetch on the 'main' entity bean, to load a partial object.
 */
public Query<T> select(String fetchProperties) {
  return query().select(fetchProperties);
}

代码示例来源:origin: org.avaje/ebean

/**
 * Apply these path properties as fetch paths to the query.
 */
public void apply(Query<?> query) {
  for (Entry<String, Props> entry : pathMap.entrySet()) {
    String path = entry.getKey();
    String props = entry.getValue().getPropertiesAsString();
    if (path == null || path.length() == 0) {
      query.select(props);
    } else {
      query.fetch(path, props);
    }
  }
}

代码示例来源:origin: org.avaje.ebean/ebean

/**
 * Apply these path properties as fetch paths to the query.
 */
public <T> void apply(Query<T> query) {
 for (Entry<String, Props> entry : pathMap.entrySet()) {
  String path = entry.getKey();
  String props = entry.getValue().getPropertiesAsString();
  if (path == null || path.isEmpty()) {
   query.select(props);
  } else {
   query.fetch(path, props);
  }
 }
}

代码示例来源:origin: org.avaje.ebeanorm/avaje-ebeanorm-api

/**
 * Apply these path properties as fetch paths to the query.
 */
public void apply(Query<?> query) {
 for (Entry<String, Props> entry : pathMap.entrySet()) {
  String path = entry.getKey();
  String props = entry.getValue().getPropertiesAsString();
  if (path == null || path.length() == 0) {
   query.select(props);
  } else {
   query.fetch(path, props);
  }
 }
}

代码示例来源:origin: org.avaje/ebean

/**
 * We need to create and execute a query to get the foreign key values as
 * the delete cascades to them (foreign keys).
 */
private Query<?> deleteRequiresQuery(BeanDescriptor<?> desc, BeanPropertyAssocOne<?>[] propImportDelete) {
  Query<?> q = server.createQuery(desc.getBeanType());
  StringBuilder sb = new StringBuilder(30);
  for (int i = 0; i < propImportDelete.length; i++) {
    sb.append(propImportDelete[i].getName()).append(",");
  }
  q.setAutofetch(false);
  q.select(sb.toString());
  return q;
}

代码示例来源:origin: org.avaje.ebeanorm/avaje-ebeanorm-server

/**
 * We need to create and execute a query to get the foreign key values as
 * the delete cascades to them (foreign keys).
 */
private Query<?> deleteRequiresQuery(BeanDescriptor<?> desc, BeanPropertyAssocOne<?>[] propImportDelete) {
  Query<?> q = server.createQuery(desc.getBeanType());
  StringBuilder sb = new StringBuilder(30);
  for (int i = 0; i < propImportDelete.length; i++) {
    sb.append(propImportDelete[i].getName()).append(",");
  }
  q.setAutofetch(false);
  q.select(sb.toString());
  return q;
}

代码示例来源:origin: org.avaje.ebean/ebean

/**
 * We need to create and execute a query to get the foreign key values as
 * the delete cascades to them (foreign keys).
 */
private Query<?> deleteRequiresQuery(BeanDescriptor<?> desc, BeanPropertyAssocOne<?>[] propImportDelete, boolean softDelete) {
 Query<?> q = server.createQuery(desc.getBeanType());
 StringBuilder sb = new StringBuilder(30);
 for (BeanPropertyAssocOne<?> aPropImportDelete : propImportDelete) {
  sb.append(aPropImportDelete.getName()).append(",");
 }
 q.setAutoTune(false);
 q.select(sb.toString());
 if (!softDelete) {
  // hard delete so we want this query to include logically deleted rows (if any)
  q.setIncludeSoftDeletes();
 }
 return q;
}

代码示例来源:origin: org.avaje/ebean

query.select(idNames).setId(id);

代码示例来源:origin: org.avaje.ebeanorm/avaje-ebeanorm-server

query.select(idNames).setId(id);

代码示例来源:origin: org.avaje.ebean/ebean

return find(type).select(idProp.getName()).setId(id).findUnique();

相关文章