Examples of Division


Examples of acceptance.hibernate.reference.Division

    }

    protected void tearDown() {
        final Session session = getSessionFactory().getCurrentSession();
        session.beginTransaction();
        final Division div = (Division)session.createQuery("from Division").uniqueResult();
        session.delete(div);
        session.getTransaction().commit();
    }
View Full Code Here

Examples of acceptance.hibernate.reference.Division

        session.delete(div);
        session.getTransaction().commit();
    }

    public void testObjectGraphWithReferences() {
        final Division memory = setupNonpersistentDivision();
        final Division persisted = setupPersistentDivision();

        final String expectedXml = xstream.toXML(memory);
        final String persistedXml = xstream.toXML(persisted);

        final Session session = getSessionFactory().getCurrentSession();
        session.beginTransaction();
        final Division loaded = (Division)session.createQuery("from Division").uniqueResult();
        final String loadedXml = xstream.toXML(loaded);
        session.getTransaction().commit();
        assertEquals(expectedXml, persistedXml);
        assertEquals(expectedXml, loadedXml);
    }
View Full Code Here

Examples of acceptance.hibernate.reference.Division

    public void testLazyProxyWithReferences() {
        setupPersistentDivision();

        final Session session = getSessionFactory().getCurrentSession();
        session.beginTransaction();
        final Division loaded = (Division)session.createQuery("from Division").uniqueResult();
        final Department dept = (Department)loaded.getDepartments().iterator().next();
        final Person person = (Person)dept.getPeople().iterator().next();
        final Site site = person.getSite();
        assertTrue(HibernateProxy.class.isAssignableFrom(site.getClass()));
        final String loadedXml = xstream.toXML(site);
        session.getTransaction().commit();
View Full Code Here

Examples of acceptance.hibernate.reference.Division

     * Create the object within a Hibernate session and persist it.
     */
    private Division setupPersistentDivision() {
        final Session session = getSessionFactory().getCurrentSession();
        session.beginTransaction();
        final Division div = new Division("Div1");
        final Department dep = new Department("Dep1", div);
        final Site site = new Site("Site1");
        /*
         * This save is necessitated by the fact that Hibernate's transitive persistence is
         * depth-first and does not do a full graph analysis. Therefore it would be possible for
View Full Code Here

Examples of acceptance.hibernate.reference.Division

    /**
     * Create the object graph in-memory without Hibernate.
     */
    private Division setupNonpersistentDivision() {
        final Division div = new Division("Div1");
        final Department dep = new Department("Dep1", div);
        final Site site = new Site("Site1");
        new Person("Tom", dep, site);
        return div;
    }
View Full Code Here

Examples of acceptance.hibernate.reference.Division

     * Load object graph with Hibernate from the database.
     */
    private Division getPersistentDivision() {
        final Session session = getSessionFactory().getCurrentSession();
        session.beginTransaction();
        final Division div = (Division)session.createQuery("from Division").uniqueResult();
        session.getTransaction().commit();
        return div;
    }
View Full Code Here

Examples of com.kolakcc.loljclient.model.Division

      }

      public void done() {
        try {
          for (TypedObject league : TOUtils.ArrayToTOArray(get().getArray("summonerLeagues"))) {
            Division d = new Division(league);
            ProfileController.this.view.addLeague(d, ProfileController.this, ProfileController.this);
          }
        } catch (InterruptedException | ExecutionException e) {
          ProfileController.this.HandleException(e);
        }
View Full Code Here

Examples of com.pre.entity.base.Division

  }

  private void show(ArrayList<String> ids) {
    setViewMode(SHOW_MODE)
    if(!ids.isEmpty()){
      Division division=manager.find(new Long(ids.get(0)));
      fillFromDB(division);
       
    }
  }
View Full Code Here

Examples of com.pre.entity.base.Division

  private void create() {
    setViewMode(CREATE_MODE)
    Button okButton=new Button("OK");
    okButton.addEventListener("onClick", new EventListener(){
      public void onEvent(Event event) throws Exception {
        Division divi=new Division();       
        fillFromView(divi);
        manager.create(divi);
        detach();           
      }
    });
View Full Code Here

Examples of com.pre.entity.base.Division

    }
    item.getDescription().setShortDescription(shortDescBox.getText());
    item.getDescription().setLongDescription(descriptionBox.getText());
    item.getDescription().setComment(commentBox.getText());
    if(!item.isLocked()){
      Division divi=dmanager.findByCode(divisionCombo.getText()).get(0);
      item.setDivision(divi);
      UnitOfMeasure uom=uomManager.findByName(uomText.getText()).get(0);
      item.setBasicUnitOfMeasure(uom);
    }
  }
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.