org.grails.datastore.mapping.query.Query.list()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(355)

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

Query.list介绍

[英]Executes the query returning zero or many results as a list.
[中]执行以列表形式返回零个或多个结果的查询。

代码示例

代码示例来源:origin: org.grails/grails-datastore-gorm

  1. protected Object invokeList() {
  2. Object result;
  3. result = query.list();
  4. return result;
  5. }

代码示例来源:origin: org.grails/grails-datastore-gorm

  1. protected Object invokeQuery(Query q) {
  2. return q.list();
  3. }

代码示例来源:origin: org.grails/grails-datastore-gorm

  1. protected Object invokeQuery(Query q) {
  2. return q.list();
  3. }

代码示例来源:origin: org.grails/grails-datastore-gorm

  1. public PagedResultList(Query query) {
  2. this.query = query;
  3. this.resultList = query == null ? Collections.<E>emptyList() : query.list();
  4. }

代码示例来源:origin: org.grails/grails-datastore-gorm

  1. /**
  2. * Defines and executes a list query in a single call. Example: Foo.createCriteria.list { }
  3. * @param callable The closure to execute
  4. *
  5. * @return The result list
  6. */
  7. public List list(Closure callable) {
  8. ensureQueryIsInitialized();
  9. invokeClosureNode(callable);
  10. return query.list();
  11. }

代码示例来源:origin: org.grails/grails-datastore-gorm

  1. /**
  2. * Defines and executes a list distinct query in a single call. Example: Foo.createCriteria.listDistinct { }
  3. * @param callable The closure to execute
  4. *
  5. * @return The result list
  6. */
  7. public List listDistinct(Closure callable) {
  8. ensureQueryIsInitialized();
  9. invokeClosureNode(callable);
  10. query.projections().distinct();
  11. return query.list();
  12. }

代码示例来源:origin: org.grails/grails-datastore-core

  1. @Override
  2. public List query(Object primaryKey) {
  3. Association inverseSide = association.getInverseSide();
  4. Query query = session.createQuery(association.getAssociatedEntity().getJavaClass());
  5. query.eq(inverseSide.getName(), primaryKey);
  6. query.projections().id();
  7. return query.list();
  8. }

相关文章