Package info.archinnov.achilles.persistence

Examples of info.archinnov.achilles.persistence.PersistenceManager.find()


        final PersistenceManager pm = pmf.createPersistenceManager();
        pm.insert(new EntityWithNewSimpleField(id, "existing", "new"));

        //Then
        final EntityWithNewSimpleField found = pm.find(EntityWithNewSimpleField.class, id);

        assertThat(found).isNotNull();
        assertThat(found.getUnmappedField()).isEqualTo("UNMAPPED");

        assertThat(pm.getProxy(EntityWithNewSimpleField.class, id).getUnmappedField()).isEqualTo("UNMAPPED");
View Full Code Here


        final PersistenceManager pm = pmf.createPersistenceManager();
        pm.insert(new ClusteredCounterEntityWithNewCounterField(id, date, CounterBuilder.incr(12L)));

        //Then
        assertThat(pm.find(ClusteredCounterEntityWithNewCounterField.class, new ClusteredCounterEntityWithNewCounterField.Compound(id, date))).isNotNull();

        session.close();
    }

    @Test(expected = AchillesInvalidTableException.class)
View Full Code Here

            final EntityWithTwoConsistency entity = new EntityWithTwoConsistency();
            entity.setId(RandomUtils.nextLong(0,Long.MAX_VALUE));

            pm.insert(entity);
            //Then
            assertThat(pm.find(EntityWithTwoConsistency.class, entity.getId())).isNotNull();
            logAsserter.assertConsistencyLevels(ONE, QUORUM);
        } finally {
            pm.getNativeSession().close();
        }
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.