本文整理了Java中com.avaje.ebean.Query.where
方法的一些代码示例,展示了Query.where
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.where
方法的具体详情如下:
包路径:com.avaje.ebean.Query
类名称:Query
方法名:where
[英]Add Expressions to the where clause with the ability to chain on the ExpressionList. You can use this for adding multiple expressions to the where clause.
Query<Order> query = Ebean.createQuery(Order.class, "top");
...
if (...) {
query.where()
.eq("status", Order.NEW)
.ilike("customer.name","rob%");
}
[中]将表达式添加到where子句,使其能够在ExpressionList上链接。可以使用它向where子句添加多个表达式
Query<Order> query = Ebean.createQuery(Order.class, "top");
...
if (...) {
query.where()
.eq("status", Order.NEW)
.ilike("customer.name","rob%");
}
代码示例来源:origin: org.avaje.ebean/ebean
@Override
public ExpressionList<T> where() {
return query.where();
}
代码示例来源:origin: org.actframework/act-ebean-java7
@Override
public EbeanQuery<MODEL_TYPE> where(Expression expression) {
q.where(expression);
qReadOnly.where(expression);
return this;
}
代码示例来源:origin: org.avaje.ebean/ebean
/**
* Return a list of expressions that will be joined by OR's.
*/
public <T> Junction<T> disjunction(Query<T> query) {
return new JunctionExpression<>(Junction.Type.OR, query, query.where());
}
代码示例来源:origin: com.typesafe.play/play-java-ebean
/**
* Adds a single <code>Expression</code> to the <code>where</code> clause and returns the query.
*/
public Query<T> where(com.avaje.ebean.Expression expression) {
return query().where(expression);
}
代码示例来源:origin: org.avaje.ebeanorm/avaje-ebeanorm-server
/**
* Return a list of expressions that will be joined by AND's.
*/
public <T> Junction<T> conjunction(Query<T> query) {
return new JunctionExpression.Conjunction<T>(query, query.where());
}
代码示例来源:origin: org.avaje.ebean/ebean
/**
* Return a list of expressions that will be joined by AND's.
*/
public <T> Junction<T> conjunction(Query<T> query) {
return new JunctionExpression<>(Junction.Type.AND, query, query.where());
}
代码示例来源:origin: org.avaje.ebean/ebean
/**
* Return a list of expressions that are wrapped by NOT.
*/
public <T> Junction<T> junction(Junction.Type type, Query<T> query) {
return new JunctionExpression<>(type, query, query.where());
}
代码示例来源:origin: com.typesafe.play/play-java-ebean
/**
* Adds expressions to the <code>where</code> clause with the ability to chain on the <code>ExpressionList</code>.
*/
public ExpressionList<T> where() {
return query().where();
}
代码示例来源:origin: org.avaje/ebean
/**
* Return a list of expressions that will be joined by AND's.
*/
public <T> Junction<T> conjunction(Query<T> query) {
return new JunctionExpression.Conjunction<T>(query, query.where());
}
代码示例来源:origin: org.avaje.ebeanorm/avaje-ebeanorm-server
/**
* Return a list of expressions that will be joined by OR's.
*/
public <T> Junction<T> disjunction(Query<T> query) {
return new JunctionExpression.Disjunction<T>(query, query.where());
}
代码示例来源:origin: com.typesafe.play/play-java-ebean
/**
* Adds additional clauses to the <code>where</code> clause.
*/
public Query<T> where(String addToWhereClause) {
return query().where(addToWhereClause);
}
代码示例来源:origin: org.avaje/ebean
/**
* Return a list of expressions that will be joined by OR's.
*/
public <T> Junction<T> disjunction(Query<T> query) {
return new JunctionExpression.Disjunction<T>(query, query.where());
}
代码示例来源:origin: org.avaje/ebean
private List<Object> findIdsByParentIdList(List<Object> parentIdist, Transaction t) {
String rawWhere = deriveWhereParentIdSql(true);
String inClause = targetIdBinder.getIdInValueExpr(parentIdist.size());
String expr = rawWhere+inClause;
EbeanServer server = getBeanDescriptor().getEbeanServer();
Query<?> q = (Query<?>)server.find(getPropertyType())
.where().raw(expr);
for (int i = 0; i < parentIdist.size(); i++) {
bindWhereParendId(q, parentIdist.get(i));
}
return server.findIds(q, t);
}
代码示例来源:origin: org.avaje.ebeanorm/avaje-ebeanorm-server
private List<Object> findIdsByParentIdList(List<Object> parentIdist, Transaction t) {
String rawWhere = deriveWhereParentIdSql(true);
String inClause = targetIdBinder.getIdInValueExpr(parentIdist.size());
String expr = rawWhere+inClause;
EbeanServer server = getBeanDescriptor().getEbeanServer();
Query<?> q = (Query<?>)server.find(getPropertyType())
.where().raw(expr);
for (int i = 0; i < parentIdist.size(); i++) {
bindWhereParendId(q, parentIdist.get(i));
}
return server.findIds(q, t);
}
代码示例来源:origin: org.avaje.ebean/ebean
private List<Object> findIdsByParentId(Object parentId, Transaction t) {
String rawWhere = deriveWhereParentIdSql(false);
List<Object> bindValues = new ArrayList<>();
bindWhereParentId(bindValues, parentId);
EbeanServer server = getBeanDescriptor().getEbeanServer();
Query<?> q = server.find(getPropertyType())
.where()
.raw(rawWhere, bindValues.toArray())
.query();
return server.findIds(q, t);
}
代码示例来源:origin: org.avaje.ebeanorm/avaje-ebeanorm-server
private List<Object> findIdsByParentId(Object parentId, Transaction t, ArrayList<Object> excludeDetailIds) {
String rawWhere = deriveWhereParentIdSql(false);
EbeanServer server = getBeanDescriptor().getEbeanServer();
Query<?> q = server.find(getPropertyType())
.where().raw(rawWhere).query();
bindWhereParendId(1, q, parentId);
if (excludeDetailIds != null && !excludeDetailIds.isEmpty()) {
Expression idIn = q.getExpressionFactory().idIn(excludeDetailIds);
q.where().not(idIn);
}
return server.findIds(q, t);
}
代码示例来源:origin: org.avaje/ebean
private List<Object> findIdsByParentId(Object parentId, Transaction t, ArrayList<Object> excludeDetailIds) {
String rawWhere = deriveWhereParentIdSql(false);
EbeanServer server = getBeanDescriptor().getEbeanServer();
Query<?> q = server.find(getPropertyType())
.where().raw(rawWhere).query();
bindWhereParendId(1, q, parentId);
if (excludeDetailIds != null && !excludeDetailIds.isEmpty()) {
Expression idIn = q.getExpressionFactory().idIn(excludeDetailIds);
q.where().not(idIn);
}
return server.findIds(q, t);
}
代码示例来源:origin: org.avaje.ebean/ebean
/**
* Fetch the destination beans that will be published to.
*/
void fetchDestinationBeans(List<T> sourceBeans, boolean asDraft) {
List<Object> ids = getBeanIds(desc, sourceBeans);
Query<T> destQuery = server.find(desc.getBeanType()).where().idIn(ids).query();
if (asDraft) {
destQuery.asDraft();
}
desc.draftQueryOptimise(destQuery);
this.destBeans = server.findMap(destQuery, transaction);
}
代码示例来源:origin: org.actframework/act-ebean-java7
private void syncEbeanQueries() {
_sync("detail");
q.orderBy();
_sync("orderBy");
q.text();
_sync("textExpressions");
q.where();
_sync("whereExpressions");
q.having();
_sync("havingExpressions");
}
代码示例来源:origin: org.avaje/ebean
private List<Object> findIdsByParentId(Object parentId, Transaction t) {
String rawWhere = deriveWhereParentIdSql(false);
EbeanServer server = getBeanDescriptor().getEbeanServer();
Query<?> q = server.find(getPropertyType())
.where().raw(rawWhere).query();
bindWhereParendId(q, parentId);
return server.findIds(q, t);
}
内容来源于网络,如有侵权,请联系作者删除!