Examples of EntityLocal


Examples of com.centraview.contact.entity.EntityLocal

    EntityVO ev = null;
    try
    {
      InitialContext ic = CVUtility.getInitialContext();
      EntityLocalHome home = (EntityLocalHome)ic.lookup("local/Entity");
      EntityLocal remote =  home.findByPrimaryKey(new EntityPK(entId,this.dataSource));
      CommonHelperLocalHome chhome= (CommonHelperLocalHome)ic.lookup("local/CommonHelper");
      CommonHelperLocal commonhelper= chhome.create();
      // Explicitly set the dataSource on the stateless Session Bean.
      commonhelper.setDataSource(this.dataSource);
      ev = remote.getEntityVOWithBasicReferences();
      ev.setSourceName(commonhelper.getSourceName(ev.getSource()));
    } catch(Exception e)
    {
      System.out.println("[Exception][ContactFacadeEJB.getEntity] Exception Thrown: "+e);
      //e.printStackTrace();
View Full Code Here

Examples of com.centraview.contact.entity.EntityLocal

    int entityID = 0;
    try {
      InitialContext ic = CVUtility.getInitialContext();
      EntityLocalHome home = (EntityLocalHome)ic.lookup("local/Entity");
      ctx.getUserTransaction().begin();
      EntityLocal remote =  home.create(entityDetails, ActionUserId, this.dataSource);
      EntityVO evo = remote.getEntityVOBasic();
      ctx.getUserTransaction().commit();

      entityID = evo.getContactID();

      HashMap historyInfo = new HashMap();
View Full Code Here

Examples of com.centraview.contact.entity.EntityLocal

      throw new AuthorizationFailedException("Entity - updateEntity");
    }
    try {
        InitialContext ic = CVUtility.getInitialContext();
        EntityLocalHome home = (EntityLocalHome)ic.lookup("local/Entity");
        EntityLocal remote = home.findByPrimaryKey(new EntityPK(entityDetail.getContactID(), this.dataSource));
 
        ctx.getUserTransaction().begin();
        remote.setEntityVO(entityDetail);
        ctx.getUserTransaction().commit();
 
        HashMap historyInfo = new HashMap();
        historyInfo.put("recordID", new Integer(entityDetail.getContactID()));
        historyInfo.put("recordTypeID", new Integer(Constants.EntityModuleID));
View Full Code Here

Examples of com.centraview.contact.entity.EntityLocal

    }

    try{
      InitialContext ic = CVUtility.getInitialContext();
      EntityLocalHome home = (EntityLocalHome)ic.lookup("local/Entity");
      EntityLocal remote =  home.findByPrimaryKey(new EntityPK(entityId,this.dataSource));

      EntityVO ev = remote.getEntityVOWithBasicReferences();

      HashMap hmDetails=new HashMap();
      hmDetails.put("title",ev.getName());
      hmDetails.put("owner",new Integer(ev.getOwner()));
      hmDetails.put("module",new Integer(1));
      hmDetails.put("recordtype",new Integer(1));

      InitialContext ctxl=CVUtility.getInitialContext();
      CvAtticLocalHome cahome=(CvAtticLocalHome)ctxl.lookup("local/CvAttic");

      CvAtticLocal caremote =cahome.create();
      caremote.setDataSource(this.dataSource);

      int transactionID=caremote.getAtticTransactionID(individualID,Constants.CV_GARBAGE,hmDetails);

      HashMap hmentity=new HashMap();
      hmentity.put("EntityID",(new Integer(ev.getContactID())).toString());
      caremote.dumpData(individualID,transactionID,"entity",hmentity);

      AddressVO adv = ev.getPrimaryAddress();

      if (adv != null)
      {
        HashMap hmaddr=new HashMap();
        hmaddr.put("AddressID",(new Integer(adv.getAddressID())).toString());
        caremote.dumpData(individualID,transactionID,"address",hmaddr);
      }

      Vector vec = ev.getCustomField();

      if (vec != null)
      {
        Iterator it = vec.iterator();
        while (it.hasNext())
        {
          CustomFieldVO cfv = (CustomFieldVO)it.next();
          String cftablename = "customfieldscalar";
          if (cfv.getFieldType() == CustomFieldVO.MULTIPLE)
          {
            cftablename = "customfieldmultiple";
          }

          HashMap hmcfv=new HashMap();
          hmcfv.put("CustomFieldID", (new Integer(cfv.getFieldID())).toString());
          caremote.dumpData(individualID, transactionID, cftablename, hmcfv);
        }
      }

      Vector mocvec = ev.getMOC();
      if (mocvec != null)
      {
        Iterator it = mocvec.iterator();
        while (it.hasNext())
        {
          MethodOfContactVO mocv = (MethodOfContactVO)it.next();

          HashMap hmmocr=new HashMap();
          hmmocr.put("MOCID",(new Integer(mocv.getMocID())).toString());
          hmmocr.put("ContactType",(new Integer(1)).toString());
          hmmocr.put("ContactID",(new Integer(entityId)).toString());
          caremote.dumpData(individualID,transactionID,"mocrelate",hmmocr);

          HashMap hmmoc=new HashMap();
          hmmoc.put("methodofcontact",(new Integer(mocv.getMocID())).toString());
          caremote.dumpData(individualID,transactionID,"methodofcontact",hmmoc);
        }
      }

      ctx.getUserTransaction().begin();
      remote.remove();
      ctx.getUserTransaction().commit();

      HashMap historyInfo = new HashMap();
      historyInfo.put("recordID",new Integer(entityId));
      historyInfo.put("recordTypeID", new Integer(Constants.EntityModuleID));
View Full Code Here

Examples of com.centraview.contact.entity.EntityLocal

        {
          HashMap entityList = (HashMap)iter.next();
          if (entityList != null)
          {
            int entityId = ((Number)entityList.get("EntityID")).intValue();
            EntityLocal remote =  home.findByPrimaryKey(new EntityPK(entityId,this.dataSource));
            ctx.getUserTransaction().begin();
            remote.remove();
            ctx.getUserTransaction().commit();
          }
        }
      }
    }catch(NamingException fe){
View Full Code Here

Examples of com.centraview.contact.entity.EntityLocal

      //for RelateEntity
      if (flvo.getRelateEntity() > 0) {
        try {
          EntityLocalHome home = (EntityLocalHome)ic.lookup("local/Entity");
          EntityLocal remote = home.findByPrimaryKey(new EntityPK(flvo.getRelateEntity(), this.dataSource));
          flvo.setRelateEntityVO(remote.getEntityVOBasic());
        } catch (Exception e) {
          // do nothing if not found
        }
      }

      //for RelateIndividual
      if (flvo.getRelateIndividual() > 0) {
        try {
          IndividualLocalHome home = (IndividualLocalHome)ic.lookup("local/Individual");
          IndividualLocal remote = home.findByPrimaryKey(new IndividualPK(flvo.getRelateIndividual(), this.dataSource));
          flvo.setRelateIndividualVO(remote.getIndividualVOBasic());
        } catch (Exception e) {
          // do nothing if not found
        }
      }
View Full Code Here

Examples of org.jboss.test.perf.interfaces.EntityLocal

   {
      if(low + 1 == high)
      {
         try
         {
            EntityLocal entity = findByPrimaryKey(low);
            entity.remove();
         }
         catch(FinderException e)
         {
            log.error("Failed to find and remove entity", e);
            throw new RemoveException("Failed to find and remove entity");
         }
      }
      else
      {
         //There is no find in range finder! till someone implements it...
         //java.util.Enumeration elements = findInRange(low, high);
         int count = 0;
         for (int i = low; i < high; i++)
         {
            try
            {
               EntityLocal entity = findByPrimaryKey(i);
               entity.remove();
               count++;
            }
            catch (Exception e)
            {
               //ignore
View Full Code Here

Examples of org.jboss.test.perf.interfaces.EntityLocal

   public void read(int id) throws RemoteException
   {
      try
      {
         EntityLocal entity = findByPrimaryKey(id);
         entity.read();
      }
      catch(FinderException e)
      {
         throw new ServerException("findByPrimaryKey failed for id="+id, e);
      }
View Full Code Here

Examples of org.jboss.test.perf.interfaces.EntityLocal

      }

      Iterator iter = elements.iterator();
      while( iter.hasNext() )
      {
         EntityLocal entity = (EntityLocal) iter.next();
         entity.read();
      }
   }
View Full Code Here

Examples of org.jboss.test.perf.interfaces.EntityLocal

   public void write(int id) throws RemoteException
   {
      try
      {
         EntityLocal entity = findByPrimaryKey(id);
         int value = entity.read();
         entity.write(value + 1);
      }
      catch(FinderException e)
      {
         throw new ServerException("findByPrimaryKey failed for id="+id, e);
      }
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.