Examples of Foo


Examples of org.apache.wicket.examples.tree.Foo

      }

      @Override
      protected void onUpdate(AjaxRequestTarget target)
      {
        Foo foo = getModelObject();

        // search first ancestor with quux not set
        while (!foo.getQuux() && foo.getParent() != null)
        {
          foo = foo.getParent();
        }

        tree.updateBranch(foo, target);
      }
View Full Code Here

Examples of org.baeldung.ex.mappingexception.cause1.persistence.model.Foo

    // tests

    @Test(expected = MappingException.class)
    @Transactional
    public final void givenEntityIsPersisted_thenException() {
        sessionFactory.getCurrentSession().saveOrUpdate(new Foo());
    }
View Full Code Here

Examples of org.baeldung.ex.mappingexception.cause2.persistence.model.Foo

    // @Test(expected = MappingException.class)
    @Test
    @Transactional
    public final void givenEntityIsPersisted_thenException() {
        sessionFactory.getCurrentSession().saveOrUpdate(new Foo());
    }
View Full Code Here

Examples of org.baeldung.ex.mappingexception.cause3.persistence.model.Foo

    // tests

    @Test(expected = MappingException.class)
    @Transactional
    public final void givenEntityIsPersisted_thenException() {
        sessionFactory.getCurrentSession().saveOrUpdate(new Foo());
    }
View Full Code Here

Examples of org.baeldung.ex.mappingexception.cause4.persistence.model.Foo

    public final void givenEntityIsPersisted_thenException() throws IOException {
        final SessionFactory sessionFactory = configureSessionFactory();

        final Session session = sessionFactory.openSession();
        session.beginTransaction();
        session.saveOrUpdate(new Foo());
        session.getTransaction().commit();
    }
View Full Code Here

Examples of org.baeldung.gson.deserialization.Foo

    @Test
    public final void whenDeserializingToSimpleObject_thenCorrect() {
        final String json = "{\"intValue\":1,\"stringValue\":\"one\"}";

        final Foo targetObject = new Gson().fromJson(json, Foo.class);

        assertEquals(targetObject.intValue, 1);
        assertEquals(targetObject.stringValue, "one");
    }
View Full Code Here

Examples of org.baeldung.persistence.model.Foo

        //
    }

    @Test
    public final void whenEntityIsCreated_thenNoExceptions() {
        service.create(new Foo(randomAlphabetic(6)));
    }
View Full Code Here

Examples of org.baeldung.web.dto.Foo

    @RequestMapping(value = "/{id}", method = RequestMethod.GET)
    @ResponseBody
    @PreAuthorize("hasRole('ROLE_USER')")
    public Foo findOne(@PathVariable("id") final Long id) {
        return new Foo();
    }
View Full Code Here

Examples of org.conserve.objects.polymorphism.Foo

   */
  @Test
  public void testAbstractMemberSearch() throws Exception
  {
    PersistenceManager persist = new PersistenceManager(driver, database, login, password);
    Foo foo = new Foo();
    ConcreteBar1 bar = new ConcreteBar1();
    bar.setAbstractName("abstract");
    bar.setConcreteName("concrete");
    foo.setBar(bar);
    persist.saveObject(foo);
    ConcreteBar2 bar2 = new ConcreteBar2();
    bar2.setAbstractName("f");
    bar2.setConcreteName("C");
    foo.setBar(bar2);
    persist.saveObject(foo);
    persist.close();

    persist = new PersistenceManager(driver, database, login, password);

    // assert that there are no ConcreteBar1 objects
    List<ConcreteBar1> cbar1s = persist.getObjects(ConcreteBar1.class, new All());
    assertEquals(0, cbar1s.size());

    // assert that there is one ConcreteBar2 object
    List<ConcreteBar2> cbar2s = persist.getObjects(ConcreteBar2.class, new All());
    assertEquals(1, cbar2s.size());

    // assert that there is one AbstractBar object
    List<AbstractBar> bars = persist.getObjects(AbstractBar.class, new All());
    assertEquals(1, bars.size());

    // create a Foo search object
    Foo searchFoo = new Foo();

    // assert that the Foo object can be retrieved with a ConcreteBar2
    // object.
    ConcreteBar2 cbar2 = new ConcreteBar2();
    cbar2.setAbstractName("f");
    cbar2.setConcreteName("C");
    searchFoo.setBar(cbar2);
    List<Foo> foos = persist.getObjects(Foo.class, new Equal(searchFoo));
    assertEquals(1, foos.size());

    // assert that the Foo object can be retrieved with a ConcreteBar1
    // object.
    ConcreteBar1 cbar1 = new ConcreteBar1();
    cbar1.setAbstractName("f");
    cbar1.setConcreteName("C");
    cbar1.setFooProperty("foo");
    searchFoo.setBar(cbar1);
    foos = persist.getObjects(Foo.class, new Equal(searchFoo, false));
    assertEquals(1, foos.size());

    // assert that the Foo object can not be retrieved with incorrect values
    cbar1.setAbstractName("fail");
    searchFoo.setBar(cbar1);
    foos = persist.getObjects(Foo.class, new Equal(searchFoo, false));
    assertEquals(0, foos.size());

    persist.close();
  }
View Full Code Here

Examples of org.crsh.command.base.entities.Foo

    em.persist(new Bar());
    em.persist(new Bar());
    em.getTransaction().commit();

    em.getTransaction().begin();
    em.persist(new Foo("foo", Calendar.getInstance()));
    Foo foo = new Foo("bar", Calendar.getInstance());
    foo.setBar(em.find(Bar.class, 1L));
    em.persist(foo);
    Foo2 foo2 = new Foo2();
    foo2.setBars(Arrays.asList(em.find(Bar.class, 1L), em.find(Bar.class, 2L)));
    em.persist(foo2);
    em.persist(new Foo2());
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.