本文整理了Java中io.ebean.Query.where
方法的一些代码示例,展示了Query.where
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.where
方法的具体详情如下:
包路径:io.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.
List orders =
[中]将表达式添加到where子句,使其能够在ExpressionList上链接。可以使用它向where子句添加多个表达式
List orders =
代码示例来源:origin: ebean-orm/ebean
@Override
public ExpressionList<T> where() {
return query.where();
}
代码示例来源:origin: ebean-orm/ebean
@Override
public ExpressionList<T> where() {
return rootQuery.where();
}
代码示例来源:origin: ebean-orm/ebean
/**
* Return a list of expressions that will be joined by AND's.
*/
@Override
public <T> Junction<T> conjunction(Query<T> query) {
return new JunctionExpression<>(Junction.Type.AND, query, query.where());
}
代码示例来源:origin: ebean-orm/ebean
/**
* Return a list of expressions that will be joined by OR's.
*/
@Override
public <T> Junction<T> disjunction(Query<T> query) {
return new JunctionExpression<>(Junction.Type.OR, query, query.where());
}
代码示例来源:origin: ebean-orm/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: ebean-orm/ebean
void bindParentIdEq(String expr, Object parentId, Query<?> q) {
if (isExportedSimple()) {
q.where().raw(expr, parentId);
} else {
// embedded ids etc
List<Object> bindValues = flattenParentId(parentId);
q.where().raw(expr, bindValues.toArray());
}
}
代码示例来源:origin: ebean-orm/ebean
void bindParentIdsIn(String expr, List<Object> parentIds, Query<?> q) {
if (isExportedSimple()) {
q.where().raw(expr, new MultiValueWrapper(parentIds));
} else {
// embedded ids etc
List<Object> bindValues = flattenParentIds(parentIds);
q.where().raw(expr, bindValues.toArray());
}
}
代码示例来源:origin: ebean-orm/ebean
@Override
public void addInheritanceWhere(Query<?> query) {
if (inheritInfo != null && !inheritInfo.isRoot()) {
query.where().eq(inheritInfo.getDiscriminatorColumn(), inheritInfo.getDiscriminatorValue());
}
}
代码示例来源:origin: ebean-orm/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: ebean-orm/ebean
/**
* Returns a set of properties if saving the bean will violate the unique constraints (defined by given properties).
*/
private Set<Property> checkUniqueness(EntityBean entityBean, BeanDescriptor<?> beanDesc, BeanProperty[] props, Transaction transaction) {
BeanProperty idProperty = beanDesc.getIdProperty();
Query<?> query = new DefaultOrmQuery<>(beanDesc, this, expressionFactory);
ExpressionList<?> exprList = query.where();
if (!entityBean._ebean_getIntercept().isNew()) {
// if model is not new, exclude ourself.
exprList.ne(idProperty.getName(), idProperty.getVal(entityBean));
}
for (Property prop : props) {
Object value = prop.getVal(entityBean);
if (value == null) {
return null;
}
exprList.eq(prop.getName(), value);
}
if (findCount(query, transaction) > 0) {
Set<Property> ret = new LinkedHashSet<>();
Collections.addAll(ret, props);
return ret;
}
return null;
}
代码示例来源:origin: org.actframework/act-ebean
@Override
public EbeanQuery<MODEL_TYPE> where(Expression expression) {
q.where(expression);
qReadOnly.where(expression);
return this;
}
代码示例来源:origin: io.ebean/ebean-querybean
/**
* Return the expression list that has been built for this query.
*/
@Nonnull
public ExpressionList<T> getExpressionList() {
return query.where();
}
代码示例来源:origin: io.ebean/ebean
/**
* Return a list of expressions that will be joined by AND's.
*/
@Override
public <T> Junction<T> conjunction(Query<T> query) {
return new JunctionExpression<>(Junction.Type.AND, query, query.where());
}
代码示例来源:origin: io.ebean/ebean
/**
* Return a list of expressions that will be joined by OR's.
*/
@Override
public <T> Junction<T> disjunction(Query<T> query) {
return new JunctionExpression<>(Junction.Type.OR, query, query.where());
}
代码示例来源:origin: io.ebean/ebean
void bindParentIdEq(String expr, Object parentId, Query<?> q) {
if (isExportedSimple()) {
q.where().raw(expr, parentId);
} else {
// embedded ids etc
List<Object> bindValues = flattenParentId(parentId);
q.where().raw(expr, bindValues.toArray());
}
}
代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean
@Override
public Optional<T> findByProperty(String fetchPath, String propertyName, Object propertyValue) {
Assert.notNull(propertyName, PROP_MUST_NOT_BE_NULL);
return query(fetchPath)
.where()
.eq(propertyName, propertyValue)
.findOneOrEmpty();
}
代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean
@Override
public boolean existsById(ID id) {
Assert.notNull(id, ID_MUST_NOT_BE_NULL);
return query().where().idEq(id).findCount() > 0;
}
代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean
@Override
public List<T> findAll(String fetchPath, Iterable<ID> ids) {
Assert.notNull(ids, "The given Iterable of Id's must not be null!");
return query(fetchPath)
.where()
.idIn((Collection<?>) ids)
.findList();
}
代码示例来源:origin: ebean-orm/ebean
q.where().idIn(idList);
if (t.isLogSummary()) {
t.logSummary("-- DeleteById of " + descriptor.getName() + " ids[" + idList + "] requires fetch of foreign key values");
q.where().idEq(id);
if (t.isLogSummary()) {
t.logSummary("-- DeleteById of " + descriptor.getName() + " id[" + id + "] requires fetch of foreign key values");
代码示例来源:origin: io.ebean/ebean
@Override
public void addInheritanceWhere(Query<?> query) {
if (inheritInfo != null && !inheritInfo.isRoot()) {
query.where().eq(inheritInfo.getDiscriminatorColumn(), inheritInfo.getDiscriminatorValue());
}
}
内容来源于网络,如有侵权,请联系作者删除!