Package org.olat.core.commons.persistence

Examples of org.olat.core.commons.persistence.DBQuery.list()


    + " where cei.type= :type ";
    DBQuery dbQuery = DBFactory.getInstance().createQuery(sqlQuery);
    dbQuery.setInteger("type", CatalogEntry.TYPE_NODE);
    // cache this query
    dbQuery.setCacheable(true);
    return dbQuery.list();
  }

 
  /**
   * Checks if the given catalog entry has any child of the given type. The
View Full Code Here


    DBQuery dbQuery = DBFactory.getInstance().createQuery(sqlQuery);
    dbQuery.setEntity("parent", ce);
    dbQuery.setInteger("type", type);
    // cache this query
    dbQuery.setCacheable(true);
    List res = dbQuery.list();
    Long cntL = (Long) res.get(0);
    return (cntL.longValue() > 0);
  }

  /**
 
View Full Code Here

    String sqlQuery = "select cei from " + " org.olat.catalog.CatalogEntryImpl as cei " + " ,org.olat.repository.RepositoryEntry as re "
        + " where cei.repositoryEntry = re AND re.key= :reKey ";
    DBQuery dbQuery = DBFactory.getInstance().createQuery(sqlQuery);
    dbQuery.setCacheable(true);
    dbQuery.setLong("reKey", repoEntry.getKey().longValue());
    List resSet = dbQuery.list();
    return resSet;
  }

  /**
   * find all catalog categorie that the given repository entry is a child of
View Full Code Here

      + " and re.key= :reKey "
      + " and cei.parent = parent ";
    DBQuery dbQuery = DBFactory.getInstance().createQuery(sqlQuery);
    dbQuery.setCacheable(true);
    dbQuery.setLong("reKey", repoEntry.getKey().longValue());
    List resSet = dbQuery.list();
    return resSet;
  }

  /**
   * find catalog entries by supplied name
View Full Code Here

  public List getCatalogEntriesByName(String name) {
    String sqlQuery = "select cei from org.olat.catalog.CatalogEntryImpl as cei where cei.name = :name";
    DBQuery dbQuery = DBFactory.getInstance().createQuery(sqlQuery);
    dbQuery.setString("name",name);
    dbQuery.setCacheable(true);
    return dbQuery.list();
   
  }

  /**
   * Find catalog entries for certain identity
View Full Code Here

      " cei.ownerGroup = sgmsi.securityGroup and" +
      " sgmsi.identity = :identity";
    DBQuery dbQuery = DBFactory.getInstance().createQuery(sqlQuery);
    dbQuery.setEntity("identity", identity);
    dbQuery.setCacheable(true);
    return dbQuery.list();
   
  }

  /**
   * add a catalog entry to the specified parent
View Full Code Here

   */
  public List getRootCatalogEntries() {
    String sqlQuery = "select cei from org.olat.catalog.CatalogEntryImpl as cei where cei.parent is null";
    DBQuery dbQuery = DBFactory.getInstance().createQuery(sqlQuery);
    dbQuery.setCacheable(true);
    return dbQuery.list();
  }

  /**
   * init called on module start-up
   */
 
View Full Code Here

      DB db = DBFactory.getInstance();
      StringBuilder q = new StringBuilder();
      q.append(" select repoEntry from org.olat.repository.RepositoryEntry as repoEntry");
      DBQuery query = db.createQuery(q.toString());
      List<RepositoryEntry> entries = (List<RepositoryEntry>) query.list();
      RepositoryManager repoManager = RepositoryManager.getInstance();
      if (log.isDebug()) log.info("Migrating " + entries.size() + " Repository Entires.");
      int counter = 0;
      for (RepositoryEntry entry : entries) {
        try{
View Full Code Here

      DB db = DBFactory.getInstance();
      StringBuilder q = new StringBuilder();
      q.append(" select context from org.olat.group.context.BGContextImpl as context");
      DBQuery query = db.createQuery(q.toString());

      List<BGContext> contexts = (List<BGContext>) query.list();
      if (log.isDebug()) log.info("Migrating " + contexts.size() + " BG Contexts.");
      BGContextManager contextManager = BGContextManagerImpl.getInstance();
      int bgcounter = 0;
      for (BGContext context : contexts) {
        try{
View Full Code Here

      log.audit("+---------------------------------------------------------------+");

      DB db = DBFactory.getInstance();
      String q = "select area from org.olat.group.area.BGAreaImpl area ";
      DBQuery query = db.createQuery(q);
      List<BGArea> areas = query.list();
      if (log.isDebug()) log.info("Migrating " + areas.size() + " BG areas.");
      BGAreaManager bgM = BGAreaManagerImpl.getInstance();
      int bgcounter = 0;

      for (BGArea area : areas) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.