Package net.sf.oqt.model

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


                    }
                }
            } 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

        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

        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

        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

  EntityVO e1 = null;
  EntityVO e2 = null;

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

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

  @Test
  public void testEqualsObject() {
    assertThat(e1.equals(new EntityVO("refa"))).isEqualTo(true);
  }
View Full Code Here

TOP

Related Classes of net.sf.oqt.model.EntityVO

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.