Examples of TestEntity


Examples of org.happyfaces.domain.TestEntity

        }

        @Override
        public TestEntity findById(Long id) {
            if (id == 22L) {
                TestEntity entity = new TestEntity();
                entity.setId(22L);
                return entity;
            }
            return null;
        }
View Full Code Here

Examples of org.hotswap.agent.plugin.hibernate.testEntities.TestEntity

    @Test
    public void testSetupOk() throws Exception {
        doInTransaction(new InTransaction() {
            @Override
            public void process(EntityManager entityManager) throws Exception {
                TestEntity entity = (TestEntity) entityManager.createQuery(
                        "from TestEntity where name='Test'").getSingleResult();

                assertNotNull(entity);
                assertEquals("Test", entity.getName());
                assertEquals("descr", entity.getDescription());
            }
        });

        swapClasses();

        doInTransaction(new InTransaction() {
            @Override
            public void process(EntityManager entityManager) throws Exception {
                TestEntity entity = (TestEntity) entityManager.createQuery(
                        "from TestEntity where name='Test'").getSingleResult();

                assertNotNull(entity);
                assertEquals("Test", entity.getName());
                assertNull(entity.getDescription());
            }
        });

    }
View Full Code Here

Examples of org.infinispan.query.api.TestEntity

         }
      });
   }

   private void queryTest() {
      cache.put("jekyll", new TestEntity("Henry", "Jekyll", 1, "dissociate identity disorder"));
      cache.put("hyde", new TestEntity("Edward", "Hyde", 2, "dissociate identity disorder"));
      SearchManager sm = Search.getSearchManager(cache);
      Query query = sm.buildQueryBuilderForClass(TestEntity.class)
            .get().keyword().onField("name").matching("Henry").createQuery();
      CacheQuery q = sm.getQuery(query);
      assertEquals(1, q.getResultSize());
View Full Code Here

Examples of org.infinispan.query.api.TestEntity

         }
      });
   }

   private void queryTest() {
      cache.put("jekyll", new TestEntity("Henry", "Jekyll", 1, "dissociate identity disorder"));
      cache.put("hyde", new TestEntity("Edward", "Hyde", 2, "dissociate identity disorder"));
      SearchManager sm = Search.getSearchManager(cache);
      Query query = sm.buildQueryBuilderForClass(TestEntity.class)
            .get().keyword().onField("name").matching("Henry").createQuery();
      CacheQuery q = sm.getQuery(query);
      assertEquals(1, q.getResultSize());
View Full Code Here

Examples of org.javaee7.jpa.datasourcedefinition_annotation_pu.entity.TestEntity

    @PersistenceContext
    private EntityManager entityManager;

    public void saveNewEntity() {
       
        TestEntity testEntity = new TestEntity();
        testEntity.setValue("mytest");
       
        entityManager.persist(testEntity);
    }
View Full Code Here

Examples of org.javaee7.jpa.datasourcedefinition_applicationxml_pu.entity.TestEntity

    @PersistenceContext
    private EntityManager entityManager;

    public void saveNewEntity() {
       
        TestEntity testEntity = new TestEntity();
        testEntity.setValue("mytest");
       
        entityManager.persist(testEntity);
    }
View Full Code Here

Examples of org.javaee7.jpa.datasourcedefinition_webxml_pu.entity.TestEntity

    @PersistenceContext
    private EntityManager entityManager;

    public void saveNewEntity() {
       
        TestEntity testEntity = new TestEntity();
        testEntity.setValue("mytest");
       
        entityManager.persist(testEntity);
    }
View Full Code Here

Examples of org.javaee7.jpa.dynamicnamedquery.entity.TestEntity

        // Nothing inserted yet, data base should not contain any entities
        // (this tests that a simple query without parameters works as named query created by Criteria)
        assertTrue(testService.getAll().size() == 0);

        // Insert one entity
        TestEntity testEntity = new TestEntity();
        testEntity.setValue("myValue");
        testService.save(testEntity);

        // The total amount of entities should be 1
        assertTrue(testService.getAll().size() == 1);
View Full Code Here

Examples of org.jboss.test.entity.interfaces.TestEntity

      getLog().debug("Retrieving home");
      TestEntityHome home = TestEntityUtil.getHome();

      getLog().debug("Creating entity");
      TestEntityValue value = new TestEntityValue("key3", null);
      TestEntity bean = home.create(value);

      getLog().debug("Removing entity internally");
      bean.remove();

      getLog().debug("Recreating the entity");
      home.create(value);
   }
View Full Code Here

Examples of org.jboss.test.entity.interfaces.TestEntity

      getLog().debug("Retrieving home");
      TestEntityHome home = TestEntityUtil.getHome();

      getLog().debug("Creating entity");
      TestEntityValue value = new TestEntityValue("key4", "original");
      TestEntity bean = home.create(value);

      getLog().debug("Access the value");
      assertEquals("original", bean.getValue1());

      getLog().debug("Change the value");
      home.changeValue1("key4", "changed");
      assertEquals("changed", bean.getValue1());
   }
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.