Examples of SbiParuse


Examples of it.eng.spagobi.behaviouralmodel.analyticaldriver.metadata.SbiParuse

      Query query = aSession.createQuery(hql);
      query.setInteger(0, parameterId.intValue());
      query.setString(1, roleName);

      SbiParuse hibParuse = (SbiParuse)query.uniqueResult()
      toReturn = toParameterUse(hibParuse);
      tx.commit();
    }catch(HibernateException he){
      logException(he);
      if (tx != null) tx.rollback()
View Full Code Here

Examples of it.eng.spagobi.behaviouralmodel.analyticaldriver.metadata.SbiParuse

    try{
      aSession = getSession();
      tx = aSession.beginTransaction();


      SbiParuse hibParuse = (SbiParuse)aSession.load(SbiParuse.class,  useID);

      fillParameterUse(aParameterUse, hibParuse);

      tx.commit();
View Full Code Here

Examples of it.eng.spagobi.behaviouralmodel.analyticaldriver.metadata.SbiParuse

    try{
      aSession = getSession();
      tx = aSession.beginTransaction();


      SbiParuse hibParuse = (SbiParuse)aSession.load(SbiParuse.class,  useID);

      fillParameterUse(aParameterUse, hibParuse);

      tx.commit();
View Full Code Here

Examples of it.eng.spagobi.behaviouralmodel.analyticaldriver.metadata.SbiParuse

    Transaction tx = null;
    try {
      aSession = getSession();
      tx = aSession.beginTransaction();

      SbiParuse hibParuse = (SbiParuse) aSession.load(SbiParuse.class,
          aParameterUse.getUseID());
      updateSbiCommonInfo4Update(hibParuse);
      hibParuse.setLabel(aParameterUse.getLabel());
      hibParuse.setName(aParameterUse.getName());
      hibParuse.setDescr(aParameterUse.getDescription());
      hibParuse.setSelectionType(aParameterUse.getSelectionType());
      hibParuse.setMultivalue(aParameterUse.isMultivalue()? new Integer(1): new Integer(0));
      hibParuse.setManualInput(aParameterUse.getManualInput());

      SbiLov hibSbiLov = (SbiLov)aSession.load(SbiLov.class, aParameterUse.getIdLov());
      //if the lov id is 0 (-1) then the modality is manual input
      //insert into the DB a null lov_id
      //if the user selected modality is manual input,and before it was a
      //lov, we don't need a lov_id and so we can delete it
      if(hibSbiLov.getLovId().intValue()== -1 || aParameterUse.getManualInput().intValue() == 1){
        hibParuse.setSbiLov(null);
      }
      else{
        hibParuse.setSbiLov(hibSbiLov);}

      //hibParuse.setSbiLov(hibSbiLov);

      Set parUseDets = hibParuse.getSbiParuseDets();
      for (Iterator it = parUseDets.iterator(); it.hasNext();) {
        aSession.delete((SbiParuseDet) it.next());
      }

      Set parUseCks = hibParuse.getSbiParuseCks();
      for (Iterator it = parUseCks.iterator(); it.hasNext();) {
        aSession.delete((SbiParuseCk) it.next());
      }

      // Recreate Relations with sbi_paruse_det
      List newRoles = aParameterUse.getAssociatedRoles();
      SbiParuseDet hibParUseDet = null;
      SbiParuseDetId hibParUseDetId = null;

      SbiExtRoles tmpExtRole = null;
      Set parUseDetsToSave = new HashSet();
      for (int i = 0; i < newRoles.size(); i++) {
        hibParUseDetId = new SbiParuseDetId();
        hibParUseDetId.setSbiParuse(hibParuse);
        tmpExtRole = (SbiExtRoles) aSession.load(SbiExtRoles.class,
            ((Role) newRoles.get(i)).getId());
        hibParUseDetId.setSbiExtRoles(tmpExtRole);
        hibParUseDet = new SbiParuseDet(hibParUseDetId);
        updateSbiCommonInfo4Insert(hibParUseDet);
        aSession.save(hibParUseDet);
        parUseDetsToSave.add(hibParUseDet);
      }

      hibParuse.getSbiParuseDets();
      hibParuse.setSbiParuseDets(parUseDetsToSave);

      // Recreate Relations with sbi_paruse_ck
      List newChecks = aParameterUse.getAssociatedChecks();
      SbiParuseCk hibParUseCk = null;
      SbiParuseCkId hibParUseCkId = null;

      SbiChecks tmpCheck = null;
      Set parUseCkToSave = new HashSet();
      for (int i = 0; i < newChecks.size(); i++) {
        hibParUseCkId = new SbiParuseCkId();
        hibParUseCkId.setSbiParuse(hibParuse);
        tmpCheck = (SbiChecks) aSession.load(SbiChecks.class,
            ((Check) newChecks.get(i)).getCheckId());
        hibParUseCkId.setSbiChecks(tmpCheck);
        hibParUseCk = new SbiParuseCk(hibParUseCkId);
        aSession.save(hibParUseCk);
        parUseCkToSave.add(hibParUseCk);
      }

      hibParuse.getSbiParuseCks();
      hibParuse.setSbiParuseCks(parUseCkToSave);
      tx.commit();

    }catch(HibernateException he){
      logException(he);
View Full Code Here

Examples of it.eng.spagobi.behaviouralmodel.analyticaldriver.metadata.SbiParuse

    Transaction tx = null;
    try{
      aSession = getSession();
      tx = aSession.beginTransaction();

      SbiParuse hibParuse = new SbiParuse();
      // Set the relation with parameter
      SbiParameters hibParameters = (SbiParameters)aSession.load(SbiParameters.class, aParameterUse.getId());
      hibParuse.setSbiParameters(hibParameters);

      // Set the relation with idLov
      SbiLov hibLov = (SbiLov)aSession.load(SbiLov.class, aParameterUse.getIdLov());
      //if the lov id is 0 (-1) then the modality is manual input
      //insert into the DB a null lov_id
      if(hibLov.getLovId().intValue()== -1)
      {hibParuse.setSbiLov(null);
      }
      else{
        hibParuse.setSbiLov(hibLov);}

      hibParuse.setLabel(aParameterUse.getLabel());
      hibParuse.setName(aParameterUse.getName());
      hibParuse.setDescr(aParameterUse.getDescription());
      hibParuse.setSelectionType(aParameterUse.getSelectionType());
      hibParuse.setMultivalue(aParameterUse.isMultivalue()? new Integer(1): new Integer(0));
      hibParuse.setManualInput(aParameterUse.getManualInput());
      updateSbiCommonInfo4Insert(hibParuse);
      Integer useId = (Integer)aSession.save(hibParuse);


      hibParuse = (SbiParuse)aSession.load(SbiParuse.class, useId);
      // Recreate Relations with sbi_paruse_det
      List newRoles = aParameterUse.getAssociatedRoles();
      SbiParuseDet hibParUseDet = null;
      SbiParuseDetId hibParUseDetId = null;

      SbiExtRoles tmpExtRole = null;
      Set parUseDetsToSave = new HashSet();
      for (int i=0; i < newRoles.size(); i++){
        hibParUseDetId = new SbiParuseDetId();
        hibParUseDetId.setSbiParuse(hibParuse);
        tmpExtRole = (SbiExtRoles)aSession.load(SbiExtRoles.class, ((Role)newRoles.get(i)).getId());
        hibParUseDetId.setSbiExtRoles(tmpExtRole);
        hibParUseDet = new SbiParuseDet(hibParUseDetId);
        updateSbiCommonInfo4Insert(hibParUseDet);
        aSession.save(hibParUseDet);
        parUseDetsToSave.add(hibParUseDet);
      }

      hibParuse.setSbiParuseDets(parUseDetsToSave);


      //       Recreate Relations with sbi_paruse_ck
      List newChecks = aParameterUse.getAssociatedChecks();
      SbiParuseCk hibParUseCk = null;
      SbiParuseCkId hibParUseCkId = null;

      SbiChecks tmpCheck = null;
      Set parUseCkToSave = new HashSet();
      for (int i=0; i < newChecks.size(); i++){
        hibParUseCkId = new SbiParuseCkId();
        hibParUseCkId.setSbiParuse(hibParuse);
        tmpCheck = (SbiChecks)aSession.load(SbiChecks.class, ((Check)newChecks.get(i)).getCheckId());
        hibParUseCkId.setSbiChecks(tmpCheck);
        hibParUseCk = new SbiParuseCk(hibParUseCkId);
        updateSbiCommonInfo4Insert(hibParUseCk);
        aSession.save(hibParUseCk);
        parUseCkToSave.add(hibParUseCk);
      }
      hibParuse.setSbiParuseCks(parUseCkToSave);

      tx.commit();

    }catch(HibernateException he){
      logException(he);
View Full Code Here

Examples of it.eng.spagobi.behaviouralmodel.analyticaldriver.metadata.SbiParuse

    try {
      aSession = getSession();
      tx = aSession.beginTransaction();

      SbiParuse hibParuse = (SbiParuse)aSession.load(SbiParuse.class, aParameterUse.getUseID());


      Set parUseDets = hibParuse.getSbiParuseDets();
      for (Iterator it = parUseDets.iterator(); it.hasNext();){
        aSession.delete((SbiParuseDet)it.next())
      }

      Set parUseCks = hibParuse.getSbiParuseCks();
      for (Iterator it = parUseCks.iterator(); it.hasNext();){
        aSession.delete((SbiParuseCk)it.next())
      }

      aSession.delete(hibParuse);
View Full Code Here

Examples of it.eng.spagobi.behaviouralmodel.analyticaldriver.metadata.SbiParuse

   * @see it.eng.spagobi.behaviouralmodel.analyticaldriver.dao.IParameterUseDAO#eraseParameterUseByParId(java.lang.Integer)
   */
  public void eraseParameterUseByParIdSameSession(Integer parId, Session sessionCurrDB) throws EMFUserError {
    logger.debug("IN");
    Session aSession = null;
    SbiParuse sbiPar = new SbiParuse();
    List parUseList = null;
    IParameterUseDAO parUseDAO = DAOFactory.getParameterUseDAO();
    parUseList = parUseDAO.loadParametersUseByParId(parId);
    Iterator i = parUseList.iterator();
    // run all parqameters Use related to Parameter
    Transaction tx = null;
    try{

      for (Iterator iterator = parUseList.iterator(); iterator.hasNext();) {

        aSession = getSession();
        tx = aSession.beginTransaction();
        Object o =  iterator.next();
        ParameterUse parameterUse = (ParameterUse) o;
        SbiParuse sbiParuse = (SbiParuse)aSession.load(SbiParuse.class, parameterUse.getUseID());

        Set checks = sbiParuse.getSbiParuseCks();
        Set dets =  sbiParuse.getSbiParuseDets();

        logger.debug("Delete details");

        for (Iterator iterator2 = dets.iterator(); iterator2.hasNext();) {
          SbiParuseDet det = (SbiParuseDet) iterator2.next();
          sessionCurrDB.delete(det);
        }
        logger.debug("Delete checks");
        for (Iterator iterator2 = checks.iterator(); iterator2.hasNext();) {
          SbiParuseCk check = (SbiParuseCk) iterator2.next();
          sessionCurrDB.delete(check);
        }

        logger.debug("Delete obj Paruse used on correlation parameters");
        eraseParameterObjUseByParuseIdSameSession(sbiParuse.getUseId(), sessionCurrDB);
        sbiPar.setUseId(sbiParuse.getUseId());
        sbiPar.setLabel(sbiParuse.getLabel());
        sbiPar.setName(sbiParuse.getName());
        sbiPar.setDescr(sbiParuse.getDescr());
        sbiPar.setSelectionType(sbiParuse.getSelectionType());
        sbiPar.setSbiParameters(sbiParuse.getSbiParameters());
        sbiPar.setManualInput(sbiParuse.getManualInput());
        sbiPar.setMultivalue(sbiParuse.getMultivalue());


        aSession.close();

        sessionCurrDB.delete(sbiPar);
View Full Code Here

Examples of it.eng.spagobi.behaviouralmodel.analyticaldriver.metadata.SbiParuse

   *
   * @return the new hibernate parameter use object
   */
  public static SbiParuse makeNewSbiParuse(SbiParuse paruse){
    logger.debug("IN");
    SbiParuse newParuse = new SbiParuse();
    newParuse.setDescr(paruse.getDescr());
    newParuse.setLabel(paruse.getLabel());
    newParuse.setName(paruse.getName());
    newParuse.setSbiLov(paruse.getSbiLov());
    newParuse.setSbiParameters(paruse.getSbiParameters());
    newParuse.setSbiParuseCks(new HashSet());
    newParuse.setSbiParuseDets(new HashSet());
    newParuse.setManualInput(paruse.getManualInput());
    newParuse.setSelectionType(paruse.getSelectionType());
    newParuse.setMultivalue(paruse.getMultivalue());
    logger.debug("OUT");
    return newParuse;
  }
View Full Code Here

Examples of it.eng.spagobi.behaviouralmodel.analyticaldriver.metadata.SbiParuse

   *
   * @return the new hibernate parameter use object
   */
  public static SbiParuse makeNewSbiParuse(SbiParuse paruse, Integer id){
    logger.debug("IN");
    SbiParuse newParuse = makeNewSbiParuse(paruse);
    newParuse.setUseId(id);
    logger.debug("OUT");
    return newParuse;
  }
View Full Code Here

Examples of it.eng.spagobi.behaviouralmodel.analyticaldriver.metadata.SbiParuse

      existingPar.setTemporalFlag(exportedParameter.getTemporalFlag());
      // deletes existing associations between object and parameters
      Set paruses = existingPar.getSbiParuses();
      Iterator parusesIt = paruses.iterator();
      while (parusesIt.hasNext()) {
        SbiParuse paruse = (SbiParuse) parusesIt.next();
        sessionCurrDB.delete(paruse);
      }
    } finally {
      logger.debug("OUT");
    }
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.