Package org.olat.core.commons.persistence

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


        + " and bgi.groupContext = :context";
    DBQuery dbq = DBFactory.getInstance().createQuery(query);
    dbq.setEntity("identId", identity);
    dbq.setString("name", areaName);
    dbq.setEntity("context", context);
    List result = dbq.list();
    return result;
  }

  /**
   * @see org.olat.group.area.BGAreaManager#findBGAreasOfBusinessGroup(org.olat.group.BusinessGroup)
View Full Code Here


  public List findBGAreasOfBusinessGroup(BusinessGroup group) {
    String q = " select area from org.olat.group.area.BGAreaImpl as area," + " org.olat.group.area.BGtoAreaRelationImpl as bgarel "
        + " where bgarel.groupArea = area" + " and bgarel.businessGroup = :group";
    DBQuery query = DBFactory.getInstance().createQuery(q);
    query.setEntity("group", group);
    List result = query.list();
    return result;
  }

  /**
   * @see org.olat.group.area.BGAreaManager#countBGAreasOfBGContext(org.olat.group.context.BGContext)
View Full Code Here

   */
  public int countBGAreasOfBGContext(BGContext groupContext) {
    String q = " select count(area) from org.olat.group.area.BGAreaImpl area where area.groupContext = :context";
    DBQuery query = DBFactory.getInstance().createQuery(q);
    query.setEntity("context", groupContext);
    return ((Long) query.list().get(0)).intValue();
  }

  /**
   * @see org.olat.group.area.BGAreaManager#findBGAreasOfBGContext(org.olat.group.context.BGContext)
   */
 
View Full Code Here

   */
  public List findBGAreasOfBGContext(BGContext groupContext) {
    String q = " select area from org.olat.group.area.BGAreaImpl area where area.groupContext = :context ";
    DBQuery query = DBFactory.getInstance().createQuery(q);
    query.setEntity("context", groupContext);
    return query.list();
  }

  /**
   * @see org.olat.group.area.BGAreaManager#isIdentityInBGArea(org.olat.core.id.Identity,
   *      java.lang.String, org.olat.group.context.BGContext)
View Full Code Here

    DBQuery query = DBFactory.getInstance().createQuery(q);
    query.setEntity("id", identity);
    query.setEntity("context", groupContext);
    query.setString("name", areaName);
    query.setCacheable(true);
    List result = query.list();
    if (result.size() == 0) return false;
    return ( ((Long) result.get(0)).intValue() > 0);
  }

  /**
 
View Full Code Here

      +"AND area.name in (:names) ";
    DBQuery query = DBFactory.getInstance().createQuery(q);
    query.setEntity("context", bgContext);
    query.setParameterList("names", allNames);

    List result = query.list();
    if (result.size() == 0) return false;
    return true;
   
  }
View Full Code Here

      + "  bgs.groupContext = :context"
      + " and bgs.name in (:names)";
    DBQuery dbq = db.createQuery(query);
    dbq.setEntity("context", groupContext);   
    dbq.setParameterList("names", names);
    int result = ((Long) dbq.list().get(0)).intValue();
    //return false if none of the groups was found
    if (result == 0) return false;
    //true if one or more groups were found
    return true;
  }
View Full Code Here

        + " and bgs.groupContext = :context" + " and bgs.name = :name";
    DBQuery dbq = db.createQuery(query);
    dbq.setString("type", type);
    dbq.setEntity("context", groupContext);
    dbq.setString("name", name);
    int result = ((Long) dbq.list().get(0)).intValue();
    if (result != 0) return true;
    return false;
  }
}
View Full Code Here

    String queryStr ="from org.olat.core.id.Identity as ident where ident.status = '"
      + Identity.STATUS_ACTIV
      + "' and (ident.lastLogin = null or ident.lastLogin < :lastLogin)"
    DBQuery dbq = DBFactory.getInstance().createQuery(queryStr);
    dbq.setDate("lastLogin", lastLoginLimit.getTime());
    List identities = dbq.list();
    // 2. get all 'active' identities in deletion process
    queryStr = "select ident from org.olat.core.id.Identity as ident"
      + " , org.olat.commons.lifecycle.LifeCycleEntry as le"
      + " where ident.key = le.persistentRef "
      + " and le.persistentTypeName ='" + IdentityImpl.class.getName() + "'"
View Full Code Here

      + " , org.olat.commons.lifecycle.LifeCycleEntry as le"
      + " where ident.key = le.persistentRef "
      + " and le.persistentTypeName ='" + IdentityImpl.class.getName() + "'"
      + " and le.action ='" + SEND_DELETE_EMAIL_ACTION + "' ";
    dbq = DBFactory.getInstance().createQuery(queryStr);
    List identitiesInProcess = dbq.list();
    // 3. Remove all identities in deletion-process from all inactive-identities
    identities.removeAll(identitiesInProcess);
    return identities;    
  }
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.