javax.persistence.EntityManager

Here are the examples of the java api class javax.persistence.EntityManager taken from open source projects.

1. JtaRollbackTest#testManualRollback()

Project: hibernate-ogm
Source File: JtaRollbackTest.java
View license
@Test
public void testManualRollback() throws Exception {
    final Game game1 = new Game("game-1", "Title 1");
    TransactionManager transactionManager = getTransactionManager();
    transactionManager.begin();
    EntityManager em = getFactory().createEntityManager();
    em.persist(game1);
    em.flush();
    em.clear();
    transactionManager.commit();
    transactionManager.begin();
    em.joinTransaction();
    em.persist(new Game("game-2", "Title 2"));
    transactionManager.rollback();
    em.close();
    NodeForGraphAssertions gameNode1 = node("g1", Game.class.getSimpleName(), ENTITY.name()).property("id", game1.getId()).property("title", game1.getTitle());
    assertThatOnlyTheseNodesExist(gameNode1);
}

2. QueryWithParametersTest#insertTestEntities()

View license
private void insertTestEntities() throws Exception {
    EntityManager entityManager = emf.createEntityManager();
    entityManager.getTransaction().begin();
    entityManager.persist(new Movie("movie-1", Genre.COMEDY, "To thatch a roof", true, new GregorianCalendar(1955, 5, 10).getTime(), (byte) 8));
    entityManager.persist(new Movie("movie-2", Genre.THRILLER, "South by Southeast", true, new GregorianCalendar(1958, 3, 2).getTime(), (byte) 9));
    entityManager.persist(new Movie("movie-3", Genre.THRILLER, "Front Door", false, new GregorianCalendar(1961, 2, 23).getTime(), (byte) 7));
    entityManager.persist(new Movie("movie-4", Genre.DRAMA, "Barnie", false, new GregorianCalendar(1962, 11, 2).getTime(), (byte) 7));
    entityManager.getTransaction().commit();
    entityManager.close();
}

3. ResourceLocalRollbackTest#testManualRollback()

View license
@Test
public void testManualRollback() throws Exception {
    Game game1 = new Game("game-1", "Title 1");
    EntityManager em = getFactory().createEntityManager();
    em.getTransaction().begin();
    em.persist(game1);
    em.flush();
    em.clear();
    em.getTransaction().commit();
    em.getTransaction().begin();
    em.persist(new Game("game-2", "Title 2"));
    em.getTransaction().rollback();
    em.close();
    NodeForGraphAssertions gameNode1 = node("g1", Game.class.getSimpleName(), ENTITY.name()).property("id", game1.getId()).property("title", game1.getTitle());
    assertThatOnlyTheseNodesExist(gameNode1);
}

4. BidirectionalManyToOneTest#prepareDb()

View license
@Before
public void prepareDb() throws Exception {
    EntityManager em = getFactory().createEntityManager();
    em.getTransaction().begin();
    salesForce = new SalesForce("red_hat");
    salesForce.setCorporation("Red Hat");
    em.persist(salesForce);
    eric = new SalesGuy("eric");
    eric.setName("Eric");
    eric.setSalesForce(salesForce);
    salesForce.getSalesGuys().add(eric);
    em.persist(eric);
    simon = new SalesGuy("simon");
    simon.setName("Simon");
    simon.setSalesForce(salesForce);
    salesForce.getSalesGuys().add(simon);
    em.persist(simon);
    em.getTransaction().commit();
    em.close();
}

5. MapTest#prepareDb()

Project: hibernate-ogm
Source File: MapTest.java
View license
@Before
public void prepareDb() throws Exception {
    final EntityManager em = getFactory().createEntityManager();
    em.getTransaction().begin();
    home = new Address();
    home.setCity("Paris");
    work = new Address();
    work.setCity("San Francisco");
    user = new User();
    user.getAddresses().put("home", home);
    user.getAddresses().put("work", work);
    user.getNicknames().add("idrA");
    user.getNicknames().add("day[9]");
    em.persist(home);
    em.persist(work);
    em.persist(user);
    em.getTransaction().commit();
    em.close();
}

6. ReferencedCompositeIdTest#prepareDb()

View license
@Before
public void prepareDb() throws Exception {
    EntityManager em = getFactory().createEntityManager();
    em.getTransaction().begin();
    britishOpen = new Tournament(new TournamentId("US", "123"), "British Open");
    playersChampionship = new Tournament(new TournamentId("US", "456"), "Player's Championship");
    em.persist(britishOpen);
    em.persist(playersChampionship);
    director = new Director("bob", "Bob", playersChampionship);
    em.persist(director);
    em.getTransaction().commit();
    em.close();
}

7. UnidirectionalManyToOneTest#prepareDb()

View license
@Before
public void prepareDb() throws Exception {
    final EntityManager em = getFactory().createEntityManager();
    em.getTransaction().begin();
    jug = new JUG("summer_camp");
    jug.setName("JUG Summer Camp");
    em.persist(jug);
    emmanuel = new Member("emmanuel");
    emmanuel.setName("Emmanuel Bernard");
    emmanuel.setMemberOf(jug);
    jerome = new Member("jerome");
    jerome.setName("Jerome");
    jerome.setMemberOf(jug);
    em.persist(emmanuel);
    em.persist(jerome);
    em.getTransaction().commit();
    em.close();
}

8. CassandraScalarQueriesTest#setUp()

View license
/**
     * Sets the up.
     * 
     * @throws Exception
     *             the exception
     */
@BeforeClass
public static void setUp() throws Exception {
    CassandraCli.cassandraSetUp();
    CassandraCli.dropKeySpace("KunderaExamples");
    HashMap propertyMap = new HashMap();
    propertyMap.put(PersistenceProperties.KUNDERA_DDL_AUTO_PREPARE, "create");
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("genericCassandraTest", propertyMap);
    EntityManager em = emf.createEntityManager();
    Object p1 = prepareData("1", 10);
    Object p2 = prepareData("2", 20);
    Object p3 = prepareData("3", 15);
    em.persist(p1);
    em.persist(p2);
    em.persist(p3);
    emf.close();
    em.close();
    entityManagerFactory = Persistence.createEntityManagerFactory("CassandraScalarQueriesTest");
    entityManager = entityManagerFactory.createEntityManager();
}

9. CountersTest#incrCounter()

Project: Kundera
Source File: CountersTest.java
View license
public void incrCounter() {
    EntityManager em = emf.createEntityManager();
    Counters counter = new Counters();
    counter.setCounter(12);
    counter.setId(id1);
    em.persist(counter);
    Counters counter1 = new Counters();
    counter1.setCounter(15);
    counter1.setId(id2);
    em.persist(counter1);
    Counters counter2 = new Counters();
    counter2.setCounter(18);
    counter2.setId(id3);
    em.persist(counter2);
    em.close();
}

10. CountersTest#decrCounter()

Project: Kundera
Source File: CountersTest.java
View license
private void decrCounter() {
    EntityManager em = emf.createEntityManager();
    Counters counter1 = new Counters();
    counter1.setCounter(-10);
    counter1.setId(id1);
    em.persist(counter1);
    Counters counter2 = new Counters();
    counter2.setCounter(-10);
    counter2.setId(id2);
    em.persist(counter2);
    Counters counter3 = new Counters();
    counter3.setCounter(-10);
    counter3.setId(id3);
    em.persist(counter3);
    em.close();
}

11. JPAProcessorImplTest#getLocalEntityManager()

View license
public EntityManager getLocalEntityManager() {
    EntityManager em = EasyMock.createMock(EntityManager.class);
    EasyMock.expect(em.createQuery("SELECT E1 FROM SalesOrderHeaders E1")).andStubReturn(getQuery());
    EasyMock.expect(em.createQuery("SELECT COUNT ( E1 ) FROM SalesOrderHeaders E1")).andStubReturn(getQueryForSelectCount());
    // For Delete
    EasyMock.expect(em.getTransaction()).andStubReturn(getLocalTransaction());
    EasyMock.expect(em.isOpen()).andReturn(false);
    em.flush();
    em.flush();
    Address obj = new Address();
    // testing void method
    em.remove(obj);
    // testing void method
    em.remove(obj);
    EasyMock.replay(em);
    return em;
}

12. StudentMongoBooleanPrimitiveTest#testPersist()

View license
public void testPersist(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    // Insert max value of boolean
    StudentMongoBooleanPrimitive studentMax = new StudentMongoBooleanPrimitive();
    studentMax.setAge((Short) getMaxValue(short.class));
    studentMax.setId((Boolean) getMaxValue(boolean.class));
    studentMax.setName((String) getMaxValue(String.class));
    em.persist(studentMax);
    // Insert min value of boolean
    StudentMongoBooleanPrimitive studentMin = new StudentMongoBooleanPrimitive();
    studentMin.setAge((Short) getMinValue(short.class));
    studentMin.setId((Boolean) getMinValue(boolean.class));
    studentMin.setName((String) getMinValue(String.class));
    em.persist(studentMin);
    em.close();
}

13. StudentMongoBooleanWrapperTest#testPersist()

View license
public void testPersist(Boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    // Insert max value of Boolean
    StudentMongoBooleanWrapper studentMax = new StudentMongoBooleanWrapper();
    studentMax.setAge((Short) getMaxValue(short.class));
    studentMax.setId((Boolean) getMaxValue(Boolean.class));
    studentMax.setName((String) getMaxValue(String.class));
    em.persist(studentMax);
    // Insert min value of Boolean
    StudentMongoBooleanWrapper studentMin = new StudentMongoBooleanWrapper();
    studentMin.setAge((Short) getMinValue(short.class));
    studentMin.setId((Boolean) getMinValue(Boolean.class));
    studentMin.setName((String) getMinValue(String.class));
    em.persist(studentMin);
    em.close();
}

14. StudentHBaseBooleanPrimitiveTest#testPersist()

View license
public void testPersist(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    // Insert max value of boolean
    StudentHBaseBooleanPrimitive studentMax = new StudentHBaseBooleanPrimitive();
    studentMax.setAge((Short) getMaxValue(short.class));
    studentMax.setId((Boolean) getMaxValue(boolean.class));
    studentMax.setName((String) getMaxValue(String.class));
    em.persist(studentMax);
    // Insert min value of boolean
    StudentHBaseBooleanPrimitive studentMin = new StudentHBaseBooleanPrimitive();
    studentMin.setAge((Short) getPartialValue(short.class));
    studentMin.setId((Boolean) getMinValue(boolean.class));
    studentMin.setName((String) getMinValue(String.class));
    em.persist(studentMin);
    em.close();
}

15. StudentHBaseBooleanWrapperTest#testPersist()

View license
public void testPersist(Boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    // Insert max value of Boolean
    StudentHBaseBooleanWrapper studentMax = new StudentHBaseBooleanWrapper();
    studentMax.setAge((Short) getMaxValue(short.class));
    studentMax.setId((Boolean) getMaxValue(Boolean.class));
    studentMax.setName((String) getMaxValue(String.class));
    em.persist(studentMax);
    // Insert min value of Boolean
    StudentHBaseBooleanWrapper studentMin = new StudentHBaseBooleanWrapper();
    studentMin.setAge((Short) getPartialValue(short.class));
    studentMin.setId((Boolean) getMinValue(Boolean.class));
    studentMin.setName((String) getMinValue(String.class));
    em.persist(studentMin);
    em.close();
}

16. StudentHBaseBooleanPrimitiveTest#persistStudents()

View license
/**
     * Persist students.
     */
public void persistStudents() {
    EntityManager em = emf.createEntityManager();
    // Insert max value of boolean
    StudentHBaseBooleanPrimitive studentMax = new StudentHBaseBooleanPrimitive();
    studentMax.setAge((Short) getMaxValue(short.class));
    studentMax.setId((Boolean) getMaxValue(boolean.class));
    studentMax.setName((String) getMaxValue(String.class));
    em.persist(studentMax);
    // Insert min value of boolean
    StudentHBaseBooleanPrimitive studentMin = new StudentHBaseBooleanPrimitive();
    studentMin.setAge((Short) getPartialValue(short.class));
    studentMin.setId((Boolean) getMinValue(boolean.class));
    studentMin.setName((String) getMinValue(String.class));
    em.persist(studentMin);
    em.close();
}

17. StudentHBaseBooleanWrapperTest#persistStudents()

View license
/**
     * Persist students.
     */
public void persistStudents() {
    EntityManager em = emf.createEntityManager();
    // Insert max value of Boolean
    StudentHBaseBooleanWrapper studentMax = new StudentHBaseBooleanWrapper();
    studentMax.setAge((Short) getMaxValue(short.class));
    studentMax.setId((Boolean) getMaxValue(Boolean.class));
    studentMax.setName((String) getMaxValue(String.class));
    em.persist(studentMax);
    // Insert min value of Boolean
    StudentHBaseBooleanWrapper studentMin = new StudentHBaseBooleanWrapper();
    studentMin.setAge((Short) getPartialValue(short.class));
    studentMin.setId((Boolean) getMinValue(Boolean.class));
    studentMin.setName((String) getMinValue(String.class));
    em.persist(studentMin);
    em.close();
}

18. CassandraScalarQueriesTest#setUp()

View license
/**
     * Sets the up.
     * 
     * @throws Exception
     *             the exception
     */
@BeforeClass
public static void setUp() throws Exception {
    CassandraCli.cassandraSetUp();
    CassandraCli.dropKeySpace("KunderaExamples");
    HashMap propertyMap = new HashMap();
    propertyMap.put(PersistenceProperties.KUNDERA_DDL_AUTO_PREPARE, "create");
    EntityManagerFactory emf = Persistence.createEntityManagerFactory("dsscalar_entity", propertyMap);
    EntityManager em = emf.createEntityManager();
    Object p1 = prepareData("1", 10);
    Object p2 = prepareData("2", 20);
    Object p3 = prepareData("3", 15);
    em.persist(p1);
    em.persist(p2);
    em.persist(p3);
}

19. StudentCouchDBBooleanPrimitiveTest#testPersist()

View license
public void testPersist(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    // Insert max value of boolean
    StudentCouchDBBooleanPrimitive studentMax = new StudentCouchDBBooleanPrimitive();
    studentMax.setAge((Short) getMaxValue(short.class));
    studentMax.setId((Boolean) getMaxValue(boolean.class));
    studentMax.setName((String) getMaxValue(String.class));
    em.persist(studentMax);
    // Insert min value of boolean
    StudentCouchDBBooleanPrimitive studentMin = new StudentCouchDBBooleanPrimitive();
    studentMin.setAge((Short) getMinValue(short.class));
    studentMin.setId((Boolean) getMinValue(boolean.class));
    studentMin.setName((String) getMinValue(String.class));
    em.persist(studentMin);
    em.close();
}

20. StudentCouchDBBooleanWrapperTest#testPersist()

View license
public void testPersist(Boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    // Insert max value of Boolean
    StudentCouchDBBooleanWrapper studentMax = new StudentCouchDBBooleanWrapper();
    studentMax.setAge((Short) getMaxValue(short.class));
    studentMax.setId((Boolean) getMaxValue(Boolean.class));
    studentMax.setName((String) getMaxValue(String.class));
    em.persist(studentMax);
    // Insert min value of Boolean
    StudentCouchDBBooleanWrapper studentMin = new StudentCouchDBBooleanWrapper();
    studentMin.setAge((Short) getMinValue(short.class));
    studentMin.setId((Boolean) getMinValue(Boolean.class));
    studentMin.setName((String) getMinValue(String.class));
    em.persist(studentMin);
    em.close();
}

21. ODataJPAProcessorDefaultTest#getLocalEntityManager()

View license
private EntityManager getLocalEntityManager() {
    EntityManager em = EasyMock.createMock(EntityManager.class);
    EasyMock.expect(em.createQuery("SELECT E1 FROM SalesOrderHeaders E1")).andStubReturn(getQuery());
    EasyMock.expect(em.createQuery("SELECT COUNT ( E1 ) FROM SalesOrderHeaders E1")).andStubReturn(getQueryForSelectCount());
    // For create
    EasyMock.expect(em.getEntityManagerFactory()).andStubReturn(mockEntityManagerFactory2());
    // For Delete
    EasyMock.expect(em.getTransaction()).andStubReturn(getLocalTransaction());
    EasyMock.expect(em.isOpen()).andReturn(true).anyTimes();
    Address obj = new Address();
    // testing void method
    em.remove(obj);
    em.flush();
    em.close();
    EasyMock.expectLastCall().anyTimes();
    EasyMock.replay(em);
    return em;
}

22. StudentRdbmsBooleanPrimitiveTest#testPersist()

View license
public void testPersist(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    // Insert max value of boolean
    StudentBooleanPrimitive studentMax = new StudentBooleanPrimitive();
    studentMax.setAge((Short) getMaxValue(short.class));
    studentMax.setId((Boolean) getMaxValue(boolean.class));
    studentMax.setName((String) getMaxValue(String.class));
    em.persist(studentMax);
    // Insert min value of boolean
    StudentBooleanPrimitive studentMin = new StudentBooleanPrimitive();
    studentMin.setAge((Short) getMinValue(short.class));
    studentMin.setId((Boolean) getMinValue(boolean.class));
    studentMin.setName((String) getMinValue(String.class));
    em.persist(studentMin);
    em.close();
}

23. StudentRdbmsBooleanWrapperTest#testPersist()

View license
public void testPersist(Boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    // Insert max value of Boolean
    StudentBooleanWrapper studentMax = new StudentBooleanWrapper();
    studentMax.setAge((Short) getMaxValue(short.class));
    studentMax.setId((Boolean) getMaxValue(Boolean.class));
    studentMax.setName((String) getMaxValue(String.class));
    em.persist(studentMax);
    // Insert min value of Boolean
    StudentBooleanWrapper studentMin = new StudentBooleanWrapper();
    studentMin.setAge((Short) getMinValue(short.class));
    studentMin.setId((Boolean) getMinValue(Boolean.class));
    studentMin.setName((String) getMinValue(String.class));
    em.persist(studentMin);
    em.close();
}

24. ExternalPropertyLoaderTest#test()

View license
/**
     * Junit to verify, if emf has been successfully loaded and user object has
     * been persisted.
     */
@Test
public void test() {
    EntityManager em = emf.createEntityManager();
    User user = new User();
    user.setFirstName("John");
    user.setLastName("Smith");
    user.setCity("London");
    em.persist(user);
    em.clear();
    // it is auto generated in-memory
    User found = em.find(User.class, user.getUserId());
    // id
    Assert.assertNotNull(found);
    Assert.assertEquals(user.getCity(), found.getCity());
    em.close();
}

25. CountersTest#deleteCounter()

Project: Kundera
Source File: CountersTest.java
View license
public void deleteCounter() {
    EntityManager em = emf.createEntityManager();
    Counters counters = new Counters();
    counters = em.find(Counters.class, id3);
    Assert.assertNotNull(counters);
    Assert.assertNotNull(counters.getCounter());
    em.remove(counters);
    EntityManager em1 = emf.createEntityManager();
    counters = em1.find(Counters.class, id3);
    Assert.assertNull(counters);
    em.close();
}

26. SuperCountersTest#deleteSuperCounter()

Project: Kundera
Source File: SuperCountersTest.java
View license
private void deleteSuperCounter() {
    EntityManager em = emf.createEntityManager();
    SuperCounters counter = new SuperCounters();
    counter = em.find(SuperCounters.class, id3);
    Assert.assertNotNull(counter);
    Assert.assertNotNull(counter.getCounter());
    Assert.assertNotNull(counter.getSubCounter());
    Assert.assertEquals(8, counter.getCounter());
    Assert.assertEquals(2225, counter.getlCounter());
    Assert.assertEquals(3, counter.getSubCounter().getSubCounter());
    em.remove(counter);
    EntityManager em1 = emf.createEntityManager();
    counter = em1.find(SuperCounters.class, id3);
    Assert.assertNull(counter);
    em.close();
}

27. StudentCassandraBooleanPrimitiveTest#testPersist()

View license
public void testPersist(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    // Insert max value of boolean
    StudentBooleanPrimitive studentMax = new StudentBooleanPrimitive();
    studentMax.setAge((Short) getMaxValue(short.class));
    studentMax.setId((Boolean) getMaxValue(boolean.class));
    studentMax.setName((String) getMaxValue(String.class));
    em.persist(studentMax);
    // Insert min value of boolean
    StudentBooleanPrimitive studentMin = new StudentBooleanPrimitive();
    studentMin.setAge((Short) getMinValue(short.class));
    studentMin.setId((Boolean) getMinValue(boolean.class));
    studentMin.setName((String) getMinValue(String.class));
    em.persist(studentMin);
    em.close();
}

28. StudentCassandraBooleanWrapperTest#testPersist()

View license
public void testPersist(Boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    // Insert max value of Boolean
    StudentBooleanWrapper studentMax = new StudentBooleanWrapper();
    studentMax.setAge((Short) getMaxValue(short.class));
    studentMax.setId((Boolean) getMaxValue(Boolean.class));
    studentMax.setName((String) getMaxValue(String.class));
    em.persist(studentMax);
    // Insert min value of Boolean
    StudentBooleanWrapper studentMin = new StudentBooleanWrapper();
    studentMin.setAge((Short) getMinValue(short.class));
    studentMin.setId((Boolean) getMinValue(Boolean.class));
    studentMin.setName((String) getMinValue(String.class));
    em.persist(studentMin);
    em.close();
}

29. JPAWorkItemHandlerTest#createOnProcessTest()

Project: jbpm
Source File: JPAWorkItemHandlerTest.java
View license
@Test
public void createOnProcessTest() throws Exception {
    String DESC = "Table";
    Product p = new Product(DESC, 10f);
    startJPAWIHProcess(JPAWorkItemHandler.CREATE_ACTION, p);
    UserTransaction ut = getUserTransaction();
    ut.begin();
    EntityManager em = emf.createEntityManager();
    TypedQuery<Product> products = em.createQuery("select p from Product p where p.description = :desc", Product.class);
    products.setParameter("desc", DESC);
    List<Product> resultList = products.getResultList();
    Product result = resultList.iterator().next();
    assertEquals(DESC, result.getDescription());
    em.remove(result);
    em.flush();
    em.close();
    ut.commit();
}

30. JPAVariableTest#setupIllegalJPAEntities()

View license
public void setupIllegalJPAEntities() {
    EntityManager manager = entityManagerFactory.createEntityManager();
    manager.getTransaction().begin();
    compoundIdJPAEntity = new CompoundIdJPAEntity();
    EmbeddableCompoundId id = new EmbeddableCompoundId();
    id.setIdPart1(123L);
    id.setIdPart2("part2");
    compoundIdJPAEntity.setId(id);
    manager.persist(compoundIdJPAEntity);
    manager.flush();
    manager.getTransaction().commit();
    manager.close();
}

31. FalconJPAService#init()

Project: falcon
Source File: FalconJPAService.java
View license
@Override
public void init() throws FalconException {
    Properties props = getPropsforStore();
    entityManagerFactory = Persistence.createEntityManagerFactory(persistenceUnit, props);
    EntityManager entityManager = getEntityManager();
    entityManager.find(EntityBean.class, 1);
    entityManager.find(InstanceBean.class, 1);
    LOG.info("All entities initialized");
    // need to use a pseudo no-op transaction so all entities, datasource
    // and connection pool are initialized one time only
    entityManager.getTransaction().begin();
    OpenJPAEntityManagerFactorySPI spi = (OpenJPAEntityManagerFactorySPI) entityManagerFactory;
    // Mask the password with '***'
    String logMsg = spi.getConfiguration().getConnectionProperties().replaceAll("Password=.*?,", "Password=***,");
    LOG.info("JPA configuration: {0}", logMsg);
    entityManager.getTransaction().commit();
    entityManager.close();
}

32. BidirectionalOneToOneTest#prepareDb()

View license
@Before
public void prepareDb() throws Exception {
    EntityManager em = getFactory().createEntityManager();
    em.getTransaction().begin();
    husband = new Husband("frederic");
    husband.setName("Frederic Joliot-Curie");
    wife = new Wife("wife");
    wife.setName("Irene Joliot-Curie");
    wife.setHusband(husband);
    husband.setWife(wife);
    em.persist(husband);
    em.persist(wife);
    em.getTransaction().commit();
    em.close();
}

33. StudentHBaseLongPrimitiveTest#testDelete()

View license
/**
     * Test delete.
     * 
     * @param useSameEm
     *            the use same em
     */
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseLongPrimitive studentMax = em.find(StudentHBaseLongPrimitive.class, getMaxValue(long.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseLongPrimitive.class, getMaxValue(long.class));
    Assert.assertNull(studentMax);
    em.close();
}

34. StudentHBaseStringTest#testDelete()

Project: Kundera
Source File: StudentHBaseStringTest.java
View license
/**
     * Test delete.
     * 
     * @param useSameEm
     *            the use same em
     */
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseString studentMax = em.find(StudentHBaseString.class, getMaxValue(String.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseString.class, getMaxValue(String.class));
    Assert.assertNull(studentMax);
    em.close();
}

35. StudentHBaseLongWrapperTest#testDelete()

View license
/**
     * Test delete.
     * 
     * @param useSameEm
     *            the use same em
     */
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseLongWrapper studentMax = em.find(StudentHBaseLongWrapper.class, getMaxValue(Long.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseLongWrapper.class, getMaxValue(Long.class));
    Assert.assertNull(studentMax);
    em.close();
}

36. StudentHBaseShortPrimitiveTest#testDelete()

View license
/**
     * Test delete.
     * 
     * @param useSameEm
     *            the use same em
     */
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseShortPrimitive studentMax = em.find(StudentHBaseShortPrimitive.class, getMaxValue(Short.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseShortPrimitive.class, getMaxValue(Short.class));
    Assert.assertNull(studentMax);
    em.close();
}

37. StudentHBaseShortWrapperTest#testDelete()

View license
/**
     * Test delete.
     * 
     * @param useSameEm
     *            the use same em
     */
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseShortWrapper studentMax = em.find(StudentHBaseShortWrapper.class, getMaxValue(Short.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseShortWrapper.class, getMaxValue(Short.class));
    Assert.assertNull(studentMax);
    em.close();
}

38. StudentHBaseSqlDateTest#testDelete()

View license
/**
     * Test delete.
     * 
     * @param useSameEm
     *            the use same em
     */
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseSqlDate studentMax = em.find(StudentHBaseSqlDate.class, getMaxValue(Date.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseSqlDate.class, getMaxValue(Date.class));
    Assert.assertNull(studentMax);
    em.close();
}

39. StudentHBaseTimestampTest#testDelete()

View license
/**
     * Test delete.
     * 
     * @param useSameEm
     *            the use same em
     */
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseTimestamp studentMax = em.find(StudentHBaseTimestamp.class, getMaxValue(Timestamp.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseTimestamp.class, getMaxValue(Timestamp.class));
    Assert.assertNull(studentMax);
    em.close();
}

40. StudentHBaseTimeTest#testDelete()

Project: Kundera
Source File: StudentHBaseTimeTest.java
View license
/**
     * Test delete.
     * 
     * @param useSameEm
     *            the use same em
     */
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseTime studentMax = em.find(StudentHBaseTime.class, getMaxValue(Time.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseTime.class, getMaxValue(Time.class));
    Assert.assertNull(studentMax);
    em.close();
}

41. StudentHBaseUUIDTest#testDelete()

Project: Kundera
Source File: StudentHBaseUUIDTest.java
View license
/**
     * Test delete.
     * 
     * @param useSameEm
     *            the use same em
     */
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseUUID studentMax = em.find(StudentHBaseUUID.class, getMaxValue(UUID.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseUUID.class, getMaxValue(UUID.class));
    Assert.assertNull(studentMax);
    em.close();
}

42. HBaseSchemaGenerationTest#init()

View license
/**
     * Inits the.
     */
private void init() {
    propertyMap.remove(PersistenceProperties.KUNDERA_DDL_AUTO_PREPARE);
    EntityManagerFactory emf = Persistence.createEntityManagerFactory(HBASE_PU, propertyMap);
    EntityManager em = emf.createEntityManager();
    UserHBase user = new UserHBase();
    user.setUserId("1");
    user.setUserName("personHbase");
    user.setPhoneNo(88888);
    em.persist(user);
    em.close();
    emf.close();
}

43. StudentKuduBytePrimitiveTest#testDelete()

View license
/**
     * Test delete.
     * 
     * @param useSameEm
     *            the use same em
     */
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentKuduBytePrimitive studentMax = em.find(StudentKuduBytePrimitive.class, getMaxValue(byte.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentKuduBytePrimitive.class, getMaxValue(byte.class));
    Assert.assertNull(studentMax);
    em.close();
}

44. StudentKuduByteWrapperTest#testDelete()

View license
/**
     * Test delete.
     * 
     * @param useSameEm
     *            the use same em
     */
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentKuduByteWrapper studentMax = em.find(StudentKuduByteWrapper.class, getMaxValue(Byte.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentKuduByteWrapper.class, getMaxValue(Byte.class));
    Assert.assertNull(studentMax);
    em.close();
}

45. StudentKuduIntegerTest#testDelete()

Project: Kundera
Source File: StudentKuduIntegerTest.java
View license
/**
     * Test delete.
     * 
     * @param useSameEm
     *            the use same em
     */
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentKuduInteger studentMax = em.find(StudentKuduInteger.class, getMaxValue(Integer.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentKuduInteger.class, getMaxValue(Integer.class));
    Assert.assertNull(studentMax);
    em.close();
}

46. StudentCouchDBStringTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentCouchDBString studentMax = em.find(StudentCouchDBString.class, getMaxValue(String.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentCouchDBString.class, getMaxValue(String.class));
    Assert.assertNull(studentMax);
    em.close();
}

47. StudentCouchDBTimestampTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentCouchDBTimestamp studentMax = em.find(StudentCouchDBTimestamp.class, getMaxValue(Timestamp.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentCouchDBTimestamp.class, getMaxValue(Timestamp.class));
    Assert.assertNull(studentMax);
    em.close();
}

48. StudentCouchDBTimeTest#testDelete()

Project: Kundera
Source File: StudentCouchDBTimeTest.java
View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentCouchDBTime studentMax = em.find(StudentCouchDBTime.class, getMaxValue(Time.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentCouchDBTime.class, getMaxValue(Time.class));
    Assert.assertNull(studentMax);
    em.close();
}

49. StudentCouchDBUUIDTest#testDelete()

Project: Kundera
Source File: StudentCouchDBUUIDTest.java
View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentCouchDBUUID studentMax = em.find(StudentCouchDBUUID.class, getMaxValue(UUID.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentCouchDBUUID.class, getMaxValue(UUID.class));
    Assert.assertNull(studentMax);
    em.close();
}

50. HBaseCompositeTypeTest#deleteNamed()

Project: Kundera
Source File: HBaseCompositeTypeTest.java
View license
/**
     * delete by Named Query.
     */
private void deleteNamed() {
    UUID timeLineId = UUID.randomUUID();
    HBaseCompoundKey key = new HBaseCompoundKey("mevivs", 1, timeLineId);
    String deleteQuery = "Delete From HBasePrimeUser u where u.tweetBody= :tweetBody";
    EntityManager em = emf.createEntityManager();
    Query q = em.createQuery(deleteQuery);
    q.setParameter("tweetBody", "after merge");
    q.executeUpdate();
    em.close();
    em = emf.createEntityManager();
    HBasePrimeUser result = em.find(HBasePrimeUser.class, key);
    Assert.assertNull(result);
    em.close();
}

51. StudentHBaseBigDecimalTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseBigDecimal studentMax = em.find(StudentHBaseBigDecimal.class, getMaxValue(BigDecimal.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseBigDecimal.class, getMaxValue(BigDecimal.class));
    Assert.assertNull(studentMax);
    em.close();
}

52. StudentHBaseBigIntegerTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseBigInteger studentMax = em.find(StudentHBaseBigInteger.class, getMaxValue(BigInteger.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseBigInteger.class, getMaxValue(BigInteger.class));
    Assert.assertNull(studentMax);
    em.close();
}

53. StudentHBaseBooleanPrimitiveTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseBooleanPrimitive studentMax = em.find(StudentHBaseBooleanPrimitive.class, getMinValue(boolean.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getPartialValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseBooleanPrimitive.class, getMinValue(boolean.class));
    Assert.assertNull(studentMax);
    em.close();
}

54. StudentHBaseBooleanWrapperTest#testDelete()

View license
public void testDelete(Boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseBooleanWrapper studentMax = em.find(StudentHBaseBooleanWrapper.class, getMinValue(Boolean.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getPartialValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseBooleanWrapper.class, getMinValue(Boolean.class));
    Assert.assertNull(studentMax);
    em.close();
}

55. StudentHBaseBytePrimitiveTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseBytePrimitive studentMax = em.find(StudentHBaseBytePrimitive.class, getMaxValue(byte.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseBytePrimitive.class, getMaxValue(byte.class));
    Assert.assertNull(studentMax);
    em.close();
}

56. StudentHBaseByteWrapperTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseByteWrapper studentMax = em.find(StudentHBaseByteWrapper.class, getMaxValue(Byte.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseByteWrapper.class, getMaxValue(Byte.class));
    Assert.assertNull(studentMax);
    em.close();
}

57. StudentHBaseCalendarTest#testPersist()

View license
public void testPersist(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    // Insert max value of Calendar
    StudentHBaseCalendar studentMax = new StudentHBaseCalendar();
    studentMax.setAge((Short) getMaxValue(short.class));
    studentMax.setId(((Calendar) getMaxValue(Calendar.class)));
    studentMax.setName((String) getMaxValue(String.class));
    em.persist(studentMax);
    em.close();
}

58. StudentHBaseCharacterTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseCharacter studentMax = em.find(StudentHBaseCharacter.class, getMaxValue(Character.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseCharacter.class, getMaxValue(Character.class));
    Assert.assertNull(studentMax);
    em.close();
}

59. StudentHBaseCharTest#testDelete()

Project: Kundera
Source File: StudentHBaseCharTest.java
View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentHBaseChar studentMax = em.find(StudentHBaseChar.class, getMaxValue(char.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentHBaseChar.class, getMaxValue(char.class));
    Assert.assertNull(studentMax);
    em.close();
}

60. StudentOracleNoSQLLongWrapperTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentOracleNoSQLLongWrapper studentMax = em.find(StudentOracleNoSQLLongWrapper.class, getMaxValue(Long.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentOracleNoSQLLongWrapper.class, getMaxValue(Long.class));
    Assert.assertNull(studentMax);
    em.close();
}

61. StudentOracleNoSQLSqlDateTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentOracleNoSQLSqlDate studentMax = em.find(StudentOracleNoSQLSqlDate.class, getMaxValue(Date.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentOracleNoSQLSqlDate.class, getMaxValue(Date.class));
    Assert.assertNull(studentMax);
    em.close();
}

62. StudentOracleNoSQLStringTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentOracleNoSQLString studentMax = em.find(StudentOracleNoSQLString.class, getMaxValue(String.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentOracleNoSQLString.class, getMaxValue(String.class));
    Assert.assertNull(studentMax);
    em.close();
}

63. RdbmsCompositeTypeTest#deleteNamed()

Project: Kundera
Source File: RdbmsCompositeTypeTest.java
View license
/**
     * delete by Named Query.
     */
private void deleteNamed() {
    UUID timeLineId = UUID.randomUUID();
    RdbmsCompoundKey key = new RdbmsCompoundKey("mevivs", 1, timeLineId.toString());
    String deleteQuery = "Delete From RdbmsPrimeUser u where u.tweetBody= :tweetBody";
    EntityManager em = emf.createEntityManager();
    Query q = em.createQuery(deleteQuery);
    q.setParameter("tweetBody", "after merge");
    q.executeUpdate();
    em.close();
    em = emf.createEntityManager();
    RdbmsPrimeUser result = em.find(RdbmsPrimeUser.class, key);
    Assert.assertNull(result);
    em.close();
}

64. StudentRdbmsBigDecimalTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentBigDecimal studentMax = em.find(StudentBigDecimal.class, getMaxValue(BigDecimal.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentBigDecimal.class, getMaxValue(BigDecimal.class));
    Assert.assertNull(studentMax);
    em.close();
}

65. StudentRdbmsBigIntegerTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentBigInteger studentMax = em.find(StudentBigInteger.class, getMaxValue(BigInteger.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentBigInteger.class, getMaxValue(BigInteger.class));
    Assert.assertNull(studentMax);
    em.close();
}

66. StudentRdbmsBooleanPrimitiveTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentBooleanPrimitive studentMax = em.find(StudentBooleanPrimitive.class, getMinValue(boolean.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMinValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentBooleanPrimitive.class, getMinValue(boolean.class));
    Assert.assertNull(studentMax);
    em.close();
}

67. StudentRdbmsBooleanWrapperTest#testDelete()

View license
public void testDelete(Boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentBooleanWrapper studentMax = em.find(StudentBooleanWrapper.class, getMinValue(Boolean.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMinValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentBooleanWrapper.class, getMinValue(Boolean.class));
    Assert.assertNull(studentMax);
    em.close();
}

68. StudentRdbmsBytePrimitiveTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentBytePrimitive studentMax = em.find(StudentBytePrimitive.class, getMaxValue(byte.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentBytePrimitive.class, getMaxValue(byte.class));
    Assert.assertNull(studentMax);
    em.close();
}

69. StudentRdbmsByteWrapperTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentByteWrapper studentMax = em.find(StudentByteWrapper.class, getMaxValue(Byte.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentByteWrapper.class, getMaxValue(Byte.class));
    Assert.assertNull(studentMax);
    em.close();
}

70. StudentRdbmsCharacterTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentCharacter studentMax = em.find(StudentCharacter.class, maxValue);
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentCharacter.class, maxValue);
    Assert.assertNull(studentMax);
    em.close();
}

71. StudentRdbmsCharTest#testDelete()

Project: Kundera
Source File: StudentRdbmsCharTest.java
View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentChar studentMax = em.find(StudentChar.class, getMaxValue(char.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentChar.class, getMaxValue(char.class));
    Assert.assertNull(studentMax);
    em.close();
}

72. StudentRdbmsDateTest#testDelete()

Project: Kundera
Source File: StudentRdbmsDateTest.java
View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentDate studentMax = em.find(StudentDate.class, getMaxValue(Date.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentDate.class, getMaxValue(Date.class));
    Assert.assertNull(studentMax);
    em.close();
}

73. StudentRdbmsDoublePrimitiveTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentDoublePrimitive studentMax = em.find(StudentDoublePrimitive.class, maxValue);
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentDoublePrimitive.class, maxValue);
    Assert.assertNull(studentMax);
    em.close();
}

74. StudentRdbmsDoubleWrapperTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentDoubleWrapper studentMax = em.find(StudentDoubleWrapper.class, maxValue);
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentDoubleWrapper.class, maxValue);
    Assert.assertNull(studentMax);
    em.close();
}

75. StudentRdbmsIntegerTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentInteger studentMax = em.find(StudentInteger.class, getMaxValue(Integer.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentInteger.class, getMaxValue(Integer.class));
    Assert.assertNull(studentMax);
    em.close();
}

76. StudentRdbmsIntTest#testDelete()

Project: Kundera
Source File: StudentRdbmsIntTest.java
View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentInt studentMax = em.find(StudentInt.class, getMaxValue(int.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentInt.class, getMaxValue(int.class));
    Assert.assertNull(studentMax);
    testPersist(useSameEm);
    em.close();
}

77. StudentRdbmsLongPrimitiveTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentLongPrimitive studentMax = em.find(StudentLongPrimitive.class, getMaxValue(long.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentLongPrimitive.class, getMaxValue(long.class));
    Assert.assertNull(studentMax);
    em.close();
}

78. StudentRdbmsLongWrapperTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentLongWrapper studentMax = em.find(StudentLongWrapper.class, getMaxValue(Long.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentLongWrapper.class, getMaxValue(Long.class));
    Assert.assertNull(studentMax);
    em.close();
}

79. StudentRdbmsShortPrimitiveTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentShortPrimitive studentMax = em.find(StudentShortPrimitive.class, getMaxValue(Short.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentShortPrimitive.class, getMaxValue(Short.class));
    Assert.assertNull(studentMax);
    em.close();
}

80. StudentRdbmsShortWrapperTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentShortWrapper studentMax = em.find(StudentShortWrapper.class, getMaxValue(Short.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentShortWrapper.class, getMaxValue(Short.class));
    Assert.assertNull(studentMax);
    em.close();
}

81. StudentRdbmsSqlDateTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentSqlDate studentMax = em.find(StudentSqlDate.class, getMaxValue());
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentSqlDate.class, getMaxValue());
    Assert.assertNull(studentMax);
    em.close();
}

82. StudentRdbmsStringTest#testDelete()

Project: Kundera
Source File: StudentRdbmsStringTest.java
View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentString studentMax = em.find(StudentString.class, getMaxValue(String.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentString.class, getMaxValue(String.class));
    Assert.assertNull(studentMax);
    em.close();
}

83. StudentRdbmsTimestampTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentTimestamp studentMax = em.find(StudentTimestamp.class, getMaxValue(Timestamp.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentTimestamp.class, getMaxValue(Timestamp.class));
    Assert.assertNull(studentMax);
    em.close();
}

84. StudentRdbmsTimeTest#testDelete()

Project: Kundera
Source File: StudentRdbmsTimeTest.java
View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentTime studentMax = em.find(StudentTime.class, getMaxValue(Time.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentTime.class, getMaxValue(Time.class));
    Assert.assertNull(studentMax);
    em.close();
}

85. LazyFetching#shouldSkipLazyFetchedProperties()

Project: modelmapper
Source File: LazyFetching.java
View license
public void shouldSkipLazyFetchedProperties() throws Throwable {
    // Given
    EntityManager em = Persistence.createEntityManagerFactory("mmtest").createEntityManager();
    Company c = new Company();
    Employee e = new Employee();
    c.employees = Arrays.asList(e);
    em.getTransaction().begin();
    em.persist(c);
    em.getTransaction().commit();
    em.clear();
    c = em.find(Company.class, 1L);
    // When
    final PersistenceUnitUtil unitUtil = em.getEntityManagerFactory().getPersistenceUnitUtil();
    modelMapper.getConfiguration().setPropertyCondition(new Condition<Object, Object>() {

        public boolean applies(MappingContext<Object, Object> context) {
            return unitUtil.isLoaded(context.getSource());
        }
    });
    CompanyDTO dto = modelMapper.map(c, CompanyDTO.class);
    // Then
    assertFalse(unitUtil.isLoaded(c, "employees"));
    assertTrue(dto.employees == null);
}

86. StudentMongoTimestampTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentMongoTimestamp studentMax = em.find(StudentMongoTimestamp.class, getMaxValue(Timestamp.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentMongoTimestamp.class, getMaxValue(Timestamp.class));
    Assert.assertNull(studentMax);
    em.close();
}

87. SpringPropertyProxyHibernateJPATests#persistNewEntityWithVersion()

View license
@Test
@Transactional
public void persistNewEntityWithVersion() throws IOException, ClassNotFoundException {
    assertTrue(isTransactional);
    Person person = new Person();
    person.setId(5000);
    person.setVersion(null);
    person.setName("Bob");
    EntityManager em = getEntityManager();
    em.persist(person);
    assertNotNull(person.getId());
    assertTrue(person.getId() > 0 && person.getId() < 5000);
    assertNotNull(person.getVersion());
    assertTrue(person.getVersion() == 0);
    person.setName("Robert");
    em.flush();
    assertTrue(person.getVersion() > 0);
}

88. SpringPropertyProxyHibernateJPATests#persistNewEntityWithPrimitiveVersion()

View license
@Test
@Transactional
public void persistNewEntityWithPrimitiveVersion() throws IOException, ClassNotFoundException {
    assertTrue(isTransactional);
    ContactInfo contactInfo = new ContactInfo();
    contactInfo.setId(0);
    contactInfo.setVersion(-1);
    contactInfo.setEmail("[email protected]");
    contactInfo.setPhone("5555551234");
    serialize(contactInfo);
    ContactInfo deserializedContactInfo = (ContactInfo) deserialize();
    assertEquals(0, deserializedContactInfo.getId());
    EntityManager em = getEntityManager();
    em.persist(deserializedContactInfo);
    assertNotNull(deserializedContactInfo.getId());
    assertTrue(deserializedContactInfo.getId() > 0);
    assertTrue(deserializedContactInfo.getVersion() == 0);
    deserializedContactInfo.setEmail("[email protected]");
    em.flush();
    assertTrue(deserializedContactInfo.getVersion() > 0);
}

89. JpaPersonAttributesGroupDefinitionDao#deletePersonAttributesGroupDefinition()

View license
@PortalTransactional
@Override
public void deletePersonAttributesGroupDefinition(IPersonAttributesGroupDefinition definition) {
    Validate.notNull(definition, "definition can not be null");
    final IPersonAttributesGroupDefinition persistentDefinition;
    final EntityManager entityManager = this.getEntityManager();
    if (entityManager.contains(definition)) {
        persistentDefinition = definition;
    } else {
        persistentDefinition = entityManager.merge(definition);
    }
    entityManager.remove(persistentDefinition);
}

90. JpaPersonAttributesGroupTestDefinitionDao#deletePersonAttributesGroupTestDefinition()

View license
@PortalTransactional
@Override
public void deletePersonAttributesGroupTestDefinition(IPersonAttributesGroupTestDefinition definition) {
    Validate.notNull(definition, "definition can not be null");
    final IPersonAttributesGroupTestDefinition persistentDefinition;
    final EntityManager entityManager = this.getEntityManager();
    if (entityManager.contains(definition)) {
        persistentDefinition = definition;
    } else {
        persistentDefinition = entityManager.merge(definition);
    }
    entityManager.remove(persistentDefinition);
}

91. JpaPersonAttributesGroupTestGroupDefinitionDao#deletePersonAttributesGroupTestGroupDefinition()

View license
@PortalTransactional
@Override
public void deletePersonAttributesGroupTestGroupDefinition(IPersonAttributesGroupTestGroupDefinition definition) {
    Validate.notNull(definition, "definition can not be null");
    final IPersonAttributesGroupTestGroupDefinition persistentDefinition;
    final EntityManager entityManager = this.getEntityManager();
    if (entityManager.contains(definition)) {
        persistentDefinition = definition;
    } else {
        persistentDefinition = entityManager.merge(definition);
    }
    entityManager.remove(persistentDefinition);
}

92. JpaMessageDao#deleteMessage()

Project: uPortal
Source File: JpaMessageDao.java
View license
@Override
@PortalTransactional
public void deleteMessage(Message message) {
    Validate.notNull(message, "message can not be null");
    final Message msg;
    final EntityManager entityManager = this.getEntityManager();
    if (entityManager.contains(message)) {
        msg = message;
    } else {
        msg = entityManager.merge(message);
    }
    entityManager.remove(msg);
}

93. JpaStylesheetDescriptorDao#deleteStylesheetDescriptor()

View license
@PortalTransactional
@Override
public void deleteStylesheetDescriptor(IStylesheetDescriptor stylesheetDescriptor) {
    Validate.notNull(stylesheetDescriptor, "definition can not be null");
    final IStylesheetDescriptor persistentStylesheetDescriptor;
    final EntityManager entityManager = this.getEntityManager();
    if (entityManager.contains(stylesheetDescriptor)) {
        persistentStylesheetDescriptor = stylesheetDescriptor;
    } else {
        persistentStylesheetDescriptor = entityManager.merge(stylesheetDescriptor);
    }
    entityManager.remove(persistentStylesheetDescriptor);
}

94. FragmentDefinitionDao#removeFragmentDefinition()

Project: uPortal
Source File: FragmentDefinitionDao.java
View license
@Override
@PortalTransactional
public void removeFragmentDefinition(FragmentDefinition fd) {
    Validate.notNull(fd, "FragmentDefinition can not be null");
    final FragmentDefinition persistentFragmentDefinition;
    final EntityManager entityManager = this.getEntityManager();
    if (entityManager.contains(fd)) {
        persistentFragmentDefinition = fd;
    } else {
        persistentFragmentDefinition = entityManager.merge(fd);
    }
    entityManager.remove(persistentFragmentDefinition);
}

95. JpaLocalAccountDaoImpl#deleteAccount()

Project: uPortal
Source File: JpaLocalAccountDaoImpl.java
View license
@Override
@PortalTransactional
public void deleteAccount(ILocalAccountPerson account) {
    Validate.notNull(account, "definition can not be null");
    final EntityManager entityManager = this.getEntityManager();
    final ILocalAccountPerson persistentAccount;
    if (entityManager.contains(account)) {
        persistentAccount = account;
    } else {
        persistentAccount = entityManager.merge(account);
    }
    entityManager.remove(persistentAccount);
}

96. JpaMarketplaceRatingDao#deleteRating()

View license
/**
     * @param entity to delete - can not be null
     */
@Override
@PortalTransactional
public void deleteRating(IMarketplaceRating marketplaceRatingImplementation) {
    Validate.notNull(marketplaceRatingImplementation, "marketplaceRatingImplementation can not be null");
    final IMarketplaceRating persistantMarketplaceRatingImpl;
    final EntityManager entityManager = this.getEntityManager();
    if (entityManager.contains(marketplaceRatingImplementation)) {
        persistantMarketplaceRatingImpl = marketplaceRatingImplementation;
    } else {
        persistantMarketplaceRatingImpl = entityManager.merge(marketplaceRatingImplementation);
    }
    entityManager.remove(persistantMarketplaceRatingImpl);
}

97. JpaPortletDefinitionDao#deletePortletDefinition()

View license
@Override
@PortalTransactional
public void deletePortletDefinition(IPortletDefinition definition) {
    Validate.notNull(definition, "definition can not be null");
    final IPortletDefinition persistentPortletDefinition;
    final EntityManager entityManager = this.getEntityManager();
    if (entityManager.contains(definition)) {
        persistentPortletDefinition = definition;
    } else {
        persistentPortletDefinition = entityManager.merge(definition);
    }
    entityManager.remove(persistentPortletDefinition);
}

98. JpaPortletEntityDao#deletePortletEntity()

Project: uPortal
Source File: JpaPortletEntityDao.java
View license
@Override
@PortalTransactional
public void deletePortletEntity(IPortletEntity portletEntity) {
    Validate.notNull(portletEntity, "portletEntity can not be null");
    final IPortletEntity persistentPortletEntity;
    final EntityManager entityManager = this.getEntityManager();
    if (entityManager.contains(portletEntity)) {
        persistentPortletEntity = portletEntity;
    } else {
        persistentPortletEntity = entityManager.merge(portletEntity);
    }
    entityManager.remove(persistentPortletEntity);
}

99. JpaPortletTypeDao#deletePortletType()

Project: uPortal
Source File: JpaPortletTypeDao.java
View license
@Override
@PortalTransactional
public void deletePortletType(IPortletType type) {
    Validate.notNull(type, "definition can not be null");
    final IPortletType persistentChanneltype;
    final EntityManager entityManager = this.getEntityManager();
    if (entityManager.contains(type)) {
        persistentChanneltype = type;
    } else {
        persistentChanneltype = entityManager.merge(type);
    }
    entityManager.remove(persistentChanneltype);
}

100. StudentOracleNoSQLFloatPrimitiveTest#testDelete()

View license
public void testDelete(boolean useSameEm) {
    EntityManager em = emf.createEntityManager();
    StudentOracleNoSQLFloatPrimitive studentMax = em.find(StudentOracleNoSQLFloatPrimitive.class, getMaxValue(float.class));
    Assert.assertNotNull(studentMax);
    Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
    Assert.assertEquals("Kuldeep", studentMax.getName());
    em.remove(studentMax);
    if (!useSameEm) {
        em.close();
        em = emf.createEntityManager();
    }
    studentMax = em.find(StudentOracleNoSQLFloatPrimitive.class, getMaxValue(float.class));
    Assert.assertNull(studentMax);
    em.close();
}