Ejemplo n.º 1
0
  public void testSelect() throws Exception {

    Session session = HibernateUtil.currentSession();
    Transaction tx = session.beginTransaction();

    List result = new ArrayList();
    result = session.createQuery("from InvasiveBreastCarcinoma").list();

    tx.commit();
    HibernateUtil.closeSession();

    for (int i = 0; i < result.size(); i++) {
      InvasiveBreastCarcinoma obj = (InvasiveBreastCarcinoma) result.get(i);
      System.out.println("ID is " + obj.getId());
      System.out.println("getLocationMVR is " + obj.getLocationMVR());

      System.out.println("loc s : ");
      List sites = (List) obj.getLocation();
      Iterator itr = sites.iterator();
      while (itr.hasNext()) {
        System.out.println(itr.next());
      }

      System.out.println("m loc s : ");
      List sites1 = (List) obj.getMicrocalcificationLocation();
      Iterator itr1 = sites1.iterator();
      while (itr1.hasNext()) {
        System.out.println(itr1.next());
      }
    }
  }
Ejemplo n.º 2
0
  public void testSelect() throws Exception {
    Session session = HibernateUtil.currentSession();
    Transaction tx = session.beginTransaction();

    List result = new ArrayList();
    result = session.createQuery("from BreastCancerTNMFinding").list();

    tx.commit();
    HibernateUtil.closeSession();

    for (int i = 0; i < result.size(); i++) {
      BreastCancerTNMFinding obj = (BreastCancerTNMFinding) result.get(i);
      System.out.println("ID is " + obj.getId());
      System.out.println("getDistantMetastasisFinding is " + obj.getDistantMetastasisFinding());

      System.out.println("LOCATIONS : ");
      List sites = (List) obj.getMetastasisAnatomicSite();
      Iterator itr = sites.iterator();
      while (itr.hasNext()) {
        System.out.println(itr.next());
      }
    }
  }