Package it.eng.spagobi.events.metadata

Examples of it.eng.spagobi.events.metadata.SbiEventsLog


    Transaction tx = null;

    try {
      aSession = getSession();
      tx = aSession.beginTransaction();     
      SbiEventsLog hibEventLog = (SbiEventsLog) aSession.load(SbiEventsLog.class, eventLog.getId());
      Set roles = hibEventLog.getRoles();
      Iterator rolesIt = roles.iterator();
      while (rolesIt.hasNext()) {
        SbiEventRole aSbiEventRole = (SbiEventRole) rolesIt.next();
        aSession.delete(aSbiEventRole);
      }
View Full Code Here


      hqlQuery.setString(0, user);
      events = hqlQuery.list();

      Iterator it = events.iterator();
      while (it.hasNext()) {
        SbiEventsLog aSbiEventsLog = (SbiEventsLog) it.next();
        Set roles = aSbiEventsLog.getRoles();
        Iterator rolesIt = roles.iterator();
        while (rolesIt.hasNext()) {
          SbiEventRole aSbiEventRole = (SbiEventRole) rolesIt.next();
          aSession.delete(aSbiEventRole);
        }
View Full Code Here

//    Query hqlQuery = null;

    try {
      aSession = getSession();
      tx = aSession.beginTransaction();
      SbiEventsLog aSbiEventsLog = (SbiEventsLog) aSession.get(SbiEventsLog.class, id);
//      hql = "from SbiEventsLog as eventlog " +
//      "where eventlog.user = '" + user + "' and " +
//      "eventlog.id = '" + id + "' and " +
//      "eventlog.date = :eventDate";
View Full Code Here

    Transaction tx = null;
    session = getSession();
    tx = session.beginTransaction();
    //SbiEventsLog hibEventLog = toSbiEventsLog(aSession, eventLog);

    SbiEventsLog hibEventLog = new SbiEventsLog();
    //hibEventLog.setId(eventLog.getId());
    hibEventLog.setUser(eventLog.getUser());
    hibEventLog.setDate(eventLog.getDate());
    hibEventLog.setDesc(eventLog.getDesc());
    hibEventLog.setParams(eventLog.getParams());
    hibEventLog.setHandlerClass(eventLog.getHandler());
    session.save(hibEventLog);
    Set hibEventRoles = new HashSet();
    List roles = eventLog.getRoles();
    Iterator rolesIt = roles.iterator();
    while (rolesIt.hasNext()) {
      String roleName = (String) rolesIt.next();
      /*String hql = "from SbiExtRoles as roles " +
           "where roles.name = '" + roleName + "'";*/

      String hql = "from SbiExtRoles as roles " +
      "where roles.name = ?";

      Query hqlQuery = session.createQuery(hql);
      hqlQuery.setString(0, roleName);
      SbiExtRoles aHibRole = (SbiExtRoles) hqlQuery.uniqueResult();
      if (aHibRole == null) {
        logger.error("Role with name = '" + roleName + "' does not exist!!");
        continue;
      }
      SbiEventRoleId eventRoleId = new SbiEventRoleId();
      eventRoleId.setEvent(hibEventLog);
      eventRoleId.setRole(aHibRole);
      SbiEventRole aSbiEventRole = new SbiEventRole(eventRoleId);
      session.save(aSbiEventRole);
      hibEventRoles.add(aSbiEventRole);
    }
    hibEventLog.setRoles(hibEventRoles);
    tx.commit();
    logger.debug("OUT");
    return hibEventLog.getId();
  }
View Full Code Here

      hibQuery.setInteger(0, hibRole.getExtRoleId().intValue());
      List eventsRole = hibQuery.list();
      Iterator it = eventsRole.iterator();
      while (it.hasNext()) {
        SbiEventRole eventRole = (SbiEventRole) it.next();
        SbiEventsLog event = eventRole.getId().getEvent();
        aSession.delete(eventRole);
        aSession.flush();
        aSession.refresh(event);
        Set roles = event.getRoles();
        if (roles.isEmpty()) {
          aSession.delete(event);
        }
      }
      aSession.delete(hibRole);
View Full Code Here

TOP

Related Classes of it.eng.spagobi.events.metadata.SbiEventsLog

Copyright © 2018 www.massapicom. 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.