Examples of EntityVO


Examples of com.centraview.contact.entity.EntityVO

        * @param indID int individual id
        * @return boolean status of operation
        */
       public boolean updateEntities(ArrayList EVOs,int indID)
       {
         EntityVO evo = null;
         ContactFacadeLocal entL = null;
         ContactHelperLocal contacthelperL = null;

         try
         {
           InitialContext ic = CVUtility.getInitialContext();
           ContactFacadeLocalHome home = (ContactFacadeLocalHome)ic.lookup("local/ContactFacade");
           entL = home.create();
           entL.setDataSource(this.dataSource);
           int size = (EVOs == null)? 0 : EVOs.size();

           ContactHelperLocalHome homeHelper = (ContactHelperLocalHome)ic.lookup("local/ContactHelper");
           contacthelperL = homeHelper.create();
           contacthelperL.setDataSource(this.dataSource);


           for ( int i=0;i<size;i++)
           {
             evo = (EntityVO) EVOs.get(i);
             AddressVO adrVO = contacthelperL.getPrimaryAddressForContact(indID, evo.getContactID(), evo.getContactType());
             evo.getPrimaryAddress().setAddressID(adrVO.getAddressID());

             Collection col = contacthelperL.getPrimaryMOCForContact(indID, evo.getContactID(), evo.getContactType());
             Iterator it = col.iterator();
             Vector vec = evo.getMOC();
             int vecsize = vec.size();
             while (it.hasNext()){
               MethodOfContactVO moc = (MethodOfContactVO)it.next();
               for (int j = 0; j < vecsize; j++){
                 if(moc.getMocType() == ((MethodOfContactVO) vec.elementAt(j)).getMocType()){
                   ((MethodOfContactVO) vec.elementAt(j)).setMocID(moc.getMocID());
                   ((MethodOfContactVO) vec.elementAt(j)).added(false);
                   ((MethodOfContactVO) vec.elementAt(j)).updated(true);
                   break;
                 }
               }
             }
             entL.updateEntity(evo,indID);
             logger.info("Updated " + evo.getContactID() + " entity record");
           }
         }catch(Exception e)
         {
           logger.debug("Error in updating Entity : "+e);
           e.printStackTrace();
View Full Code Here

Examples of com.centraview.contact.entity.EntityVO

       public void deleteEntities(String modulename, ArrayList arl, int indId)
       {
         if (arl==null) {
            return;
         }
         EntityVO pvo = new EntityVO();
         String extId = "";
         int intId = 0;

         Iterator it = arl.iterator();

         ContactFacadeLocal helperL = null;
         try
         {
           InitialContext ic = CVUtility.getInitialContext();
           ContactFacadeLocalHome home = (ContactFacadeLocalHome ) ic.lookup("local/ContactFacade");
           helperL = home.create();

           while(it.hasNext())
           {
             pvo = (EntityVO)it.next();
             extId = pvo.getExternalID();
             intId = this.getCVidForExtid(modulename,extId);
             helperL.deleteEntity(intId, indId);

             logger.info("Entity " + intId +" object deleted");
           }
View Full Code Here

Examples of net.sf.oqt.model.EntityVO

    final Set<PackageVO> packages = EntityFinder.findAllEntities(basePackages);
    assertThat(packages).isNotNull().isNotEmpty().hasSize(1);
    final PackageVO p = packages.iterator().next();
    assertThat(p).isNotNull().isEqualTo(new PackageVO(RefA.class.getPackage().getName()));
    assertThat(p.getEntities()).isNotNull().isNotEmpty().hasSize(TestInfo.numberOfEntitiesInSubPackage);
    final EntityVO e1 = packages.iterator().next().getEntities().get(0);
    final EntityVO e2 = packages.iterator().next().getEntities().get(1);
    assertThat(e1).isNotNull().isEqualTo(new EntityVO("RefA"));
    assertThat(e2).isNotNull().isEqualTo(new EntityVO("RefB"));

    assertThat(e1.getQueries()).isNotNull().isNotEmpty().hasSize(1);
    assertThat(e2.getQueries()).isNotNull().isNotEmpty().hasSize(2);

    assertThat(e1.getQueries().iterator().next().getName()).isNotNull().isEqualTo("findByReferenceADescription");
    assertThat(e1.getQueries().iterator().next().getJPQLQuery()).isNotNull().isEqualTo("select ent from RefA ent where ent.description like :descr");

    assertThat(e2.getQueries().iterator().next().getName()).isNotNull().isEqualTo("getRefBByCode");
    assertThat(e2.getQueries().iterator().next().getJPQLQuery()).isNotNull().isEqualTo("select ent from RefB ent where ent.code = :code");
  }
View Full Code Here

Examples of net.sf.oqt.model.EntityVO

                    }
                }
            } else {
                packages.add(p);
            }
            p.getEntities().add(new EntityVO(clazz.getSimpleName()));
        }
        for (final PackageVO p : packages) {
            Collections.sort(p.getEntities());
        }
        findAllNamedQueries(packages);
View Full Code Here

Examples of net.sf.oqt.model.EntityVO

        final Iterator<PackageVO> pIt = annotated.iterator();
        while (pIt.hasNext()) {
            final PackageVO packge = pIt.next();
            final Iterator<EntityVO> qIt = packge.getEntities().iterator();
            while (qIt.hasNext()) {
                final EntityVO entity = qIt.next();
                final Class<?> clazz = Class.forName(packge.getName() + "." + entity.getName());
                final Annotation[] annotations = clazz.getAnnotations();
                for (final Annotation annotation : annotations) {
                    if (annotation.annotationType().equals(NamedQuery.class)) {
                        final NamedQuery nq = (NamedQuery) annotation;
                        entity.getQueries().add(new QueryVO(nq.name(), nq.query()));
                    } else if (annotation.annotationType().equals(NamedQueries.class)) {
                        final NamedQueries nqs = (NamedQueries) annotation;
                        for (final NamedQuery nq : nqs.value()) {
                            entity.getQueries().add(new QueryVO(nq.name(), nq.query()));
                        }
                    }
                }
            }
            Collections.sort(packge.getEntities());
View Full Code Here

Examples of net.sf.oqt.model.EntityVO

        final Iterator<PackageVO> packIt = packages.iterator();
        while (packIt.hasNext()) {
            final PackageVO pack = packIt.next();
            final Iterator<EntityVO> entIt = pack.getEntities().iterator();
            while (entIt.hasNext()) {
                final EntityVO ent = entIt.next();
                final Iterator<QueryVO> qIt = ent.getQueries().iterator();
                while (qIt.hasNext()) {
                    final QueryVO q = qIt.next();
                    transform(q);
                }
            }
View Full Code Here

Examples of net.sf.oqt.model.EntityVO

        final Iterator<PackageVO> packIt = packages.iterator();
        while (packIt.hasNext()) {
            final PackageVO pack = packIt.next();
            final Iterator<EntityVO> entIt = pack.getEntities().iterator();
            while (entIt.hasNext()) {
                final EntityVO ent = entIt.next();
                final Iterator<QueryVO> qIt = ent.getQueries().iterator();
                while (qIt.hasNext()) {
                    final QueryVO q = qIt.next();
                    validate(q);
                }
            }
View Full Code Here

Examples of net.sf.oqt.model.EntityVO

  EntityVO e1 = null;
  EntityVO e2 = null;

  @Before
  public void setUp() throws Exception {
    e1 = new EntityVO("RefA");
    e2 = new EntityVO("RefB");
  }
View Full Code Here

Examples of net.sf.oqt.model.EntityVO

    assertThat(e1.compareTo(e1)).isEqualTo(0);
  }

  @Test
  public void testEqualsObject() {
    assertThat(e1.equals(new EntityVO("refa"))).isEqualTo(true);
  }
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.