use of com.liferay.blade.samples.jndiservicebuilder.model.Region in project liferay-blade-samples by liferay.
the class RegionPersistenceImpl method clearCache.
@Override
public void clearCache(List<Region> regions) {
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
for (Region region : regions) {
entityCache.removeResult(RegionModelImpl.ENTITY_CACHE_ENABLED, RegionImpl.class, region.getPrimaryKey());
}
}
use of com.liferay.blade.samples.jndiservicebuilder.model.Region in project liferay-blade-samples by liferay.
the class RegionPersistenceTest method testDynamicQueryByProjectionExisting.
@Test
public void testDynamicQueryByProjectionExisting() throws Exception {
Region newRegion = addRegion();
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Region.class, _dynamicQueryClassLoader);
dynamicQuery.setProjection(ProjectionFactoryUtil.property("regionId"));
Object newRegionId = newRegion.getRegionId();
dynamicQuery.add(RestrictionsFactoryUtil.in("regionId", new Object[] { newRegionId }));
List<Object> result = _persistence.findWithDynamicQuery(dynamicQuery);
Assert.assertEquals(1, result.size());
Object existingRegionId = result.get(0);
Assert.assertEquals(existingRegionId, newRegionId);
}
use of com.liferay.blade.samples.jndiservicebuilder.model.Region in project liferay-blade-samples by liferay.
the class RegionPersistenceTest method testDynamicQueryByPrimaryKeyMissing.
@Test
public void testDynamicQueryByPrimaryKeyMissing() throws Exception {
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Region.class, _dynamicQueryClassLoader);
dynamicQuery.add(RestrictionsFactoryUtil.eq("regionId", RandomTestUtil.nextLong()));
List<Region> result = _persistence.findWithDynamicQuery(dynamicQuery);
Assert.assertEquals(0, result.size());
}
use of com.liferay.blade.samples.jndiservicebuilder.model.Region in project liferay-blade-samples by liferay.
the class RegionPersistenceTest method testRemove.
@Test
public void testRemove() throws Exception {
Region newRegion = addRegion();
_persistence.remove(newRegion);
Region existingRegion = _persistence.fetchByPrimaryKey(newRegion.getPrimaryKey());
Assert.assertNull(existingRegion);
}
use of com.liferay.blade.samples.jndiservicebuilder.model.Region in project liferay-blade-samples by liferay.
the class RegionPersistenceTest method testFetchByPrimaryKeyMissing.
@Test
public void testFetchByPrimaryKeyMissing() throws Exception {
long pk = RandomTestUtil.nextLong();
Region missingRegion = _persistence.fetchByPrimaryKey(pk);
Assert.assertNull(missingRegion);
}
Aggregations