Here are the examples of the java api com.liferay.blade.samples.jndiservicebuilder.service.persistence.RegionPersistence.findByPrimaryKey() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
5 Examples
18
View Complete Implementation : RegionLocalServiceBaseImpl.java
Copyright Apache License 2.0
Author : liferay
Copyright Apache License 2.0
Author : liferay
/**
* Returns the region with the primary key.
*
* @param regionId the primary key of the region
* @return the region
* @throws PortalException if a region with the primary key could not be found
*/
@Override
public Region getRegion(long regionId) throws PortalException {
return regionPersistence.findByPrimaryKey(regionId);
}
18
View Complete Implementation : RegionPersistenceTest.java
Copyright Apache License 2.0
Author : liferay
Copyright Apache License 2.0
Author : liferay
@Test(expected = NoSuchRegionException.clreplaced)
public void testFindByPrimaryKeyMissing() throws Exception {
long pk = RandomTestUtil.nextLong();
_persistence.findByPrimaryKey(pk);
}
17
View Complete Implementation : RegionLocalServiceBaseImpl.java
Copyright Apache License 2.0
Author : liferay
Copyright Apache License 2.0
Author : liferay
@Override
public PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException {
return regionPersistence.findByPrimaryKey(primaryKeyObj);
}
15
View Complete Implementation : RegionPersistenceTest.java
Copyright Apache License 2.0
Author : liferay
Copyright Apache License 2.0
Author : liferay
@Test
public void testFindByPrimaryKeyExisting() throws Exception {
Region newRegion = addRegion();
Region existingRegion = _persistence.findByPrimaryKey(newRegion.getPrimaryKey());
replacedert.replacedertEquals(existingRegion, newRegion);
}
8
View Complete Implementation : RegionPersistenceTest.java
Copyright Apache License 2.0
Author : liferay
Copyright Apache License 2.0
Author : liferay
@Test
public void testUpdateExisting() throws Exception {
long pk = RandomTestUtil.nextLong();
Region newRegion = _persistence.create(pk);
newRegion.setRegionName(RandomTestUtil.randomString());
_regions.add(_persistence.update(newRegion));
Region existingRegion = _persistence.findByPrimaryKey(newRegion.getPrimaryKey());
replacedert.replacedertEquals(existingRegion.getRegionId(), newRegion.getRegionId());
replacedert.replacedertEquals(existingRegion.getRegionName(), newRegion.getRegionName());
}