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

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

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

Query.setId介绍

[英]Set the Id value to query. This is used with findUnique().

You can use this to have further control over the query. For example adding fetch joins.

Query<Order> query = Ebean.createQuery(Order.class); 
Order order = query.setId(1).join("details").findUnique(); 
List<OrderDetail> details = order.getDetails(); 
...

[中]设置要查询的Id值。这与findUnique()一起使用。
您可以使用它来进一步控制查询。例如,添加fetch连接。

Query<Order> query = Ebean.createQuery(Order.class); 
Order order = query.setId(1).join("details").findUnique(); 
List<OrderDetail> details = order.getDetails(); 
...

代码示例

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

@Override
public EbeanQuery<MODEL_TYPE> setId(Object id) {
  q.setId(id);
  qReadOnly.setId(id);
  return this;
}

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

/**
 * Sets the ID value to query.
 */
public Query<T> setId(Object id) {
  return query().setId(id);
}

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

@Override
public <T> T publish(Class<T> beanType, Object id, Transaction transaction) {
 Query<T> query = find(beanType).setId(id);
 List<T> liveBeans = publish(query, transaction);
 return (liveBeans.size() == 1) ? liveBeans.get(0) : null;
}

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

@Override
public <T> T draftRestore(Class<T> beanType, Object id, Transaction transaction) {
 Query<T> query = find(beanType).setId(id);
 List<T> beans = draftRestore(query, transaction);
 return (beans.size() == 1) ? beans.get(0) : null;
}

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

/**
 * Find a bean using its unique id.
 */
public <T> T find(Class<T> beanType, Object id, Transaction t) {
 if (id == null) {
  throw new NullPointerException("The id is null");
 }
 Query<T> query = createQuery(beanType).setId(id);
 return findId(query, t);
}

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

/**
 * Find a bean using its unique id.
 */
public <T> T find(Class<T> beanType, Object id, Transaction t) {
 if (id == null) {
  throw new NullPointerException("The id is null");
 }
 Query<T> query = createQuery(beanType).setId(id);
 return findId(query, t);
}

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

@Override
public ExpressionList<T> idEq(Object value) {
 if (query != null && parentExprList == null) {
  query.setId(value);
 } else {
  add(expr.idEq(value));
 }
 return this;
}

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

public ExpressionList<T> idEq(Object value) {
 if (query != null && parentExprList == null) {
  query.setId(value);
 } else {
  add(expr.idEq(value));
 }
 return this;
}

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

public ExpressionList<T> idEq(Object value) {
 if (query != null && parentExprList == null) {
  query.setId(value);
 } else {
  add(expr.idEq(value));
 }
 return this;
}

代码示例来源: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();

相关文章