com.liferay.blade.basic.service.persistence.FooPersistence.fetchByPrimaryKey() - java examples

Here are the examples of the java api com.liferay.blade.basic.service.persistence.FooPersistence.fetchByPrimaryKey() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

4 Examples 7

19 View Complete Implementation : FooLocalServiceBaseImpl.java
Copyright Apache License 2.0
Author : liferay
@Override
public Foo fetchFoo(long fooId) {
    return fooPersistence.fetchByPrimaryKey(fooId);
}

17 View Complete Implementation : FooPersistenceTest.java
Copyright Apache License 2.0
Author : liferay
@Test
public void testFetchByPrimaryKeyMissing() throws Exception {
    long pk = RandomTestUtil.nextLong();
    Foo missingFoo = _persistence.fetchByPrimaryKey(pk);
    replacedert.replacedertNull(missingFoo);
}

16 View Complete Implementation : FooPersistenceTest.java
Copyright Apache License 2.0
Author : liferay
@Test
public void testFetchByPrimaryKeyExisting() throws Exception {
    Foo newFoo = addFoo();
    Foo existingFoo = _persistence.fetchByPrimaryKey(newFoo.getPrimaryKey());
    replacedert.replacedertEquals(existingFoo, newFoo);
}

15 View Complete Implementation : FooPersistenceTest.java
Copyright Apache License 2.0
Author : liferay
@Test
public void testRemove() throws Exception {
    Foo newFoo = addFoo();
    _persistence.remove(newFoo);
    Foo existingFoo = _persistence.fetchByPrimaryKey(newFoo.getPrimaryKey());
    replacedert.replacedertNull(existingFoo);
}