use of com.liferay.blade.workflow.basic.model.Baz in project liferay-blade-samples by liferay.
the class BazPersistenceTest method testFetchByPrimaryKeyMissing.
@Test
public void testFetchByPrimaryKeyMissing() throws Exception {
long pk = RandomTestUtil.nextLong();
Baz missingBaz = _persistence.fetchByPrimaryKey(pk);
Assert.assertNull(missingBaz);
}
use of com.liferay.blade.workflow.basic.model.Baz in project liferay-blade-samples by liferay.
the class BazPersistenceTest method testDynamicQueryByProjectionExisting.
@Test
public void testDynamicQueryByProjectionExisting() throws Exception {
Baz newBaz = addBaz();
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Baz.class, _dynamicQueryClassLoader);
dynamicQuery.setProjection(ProjectionFactoryUtil.property("bazId"));
Object newBazId = newBaz.getBazId();
dynamicQuery.add(RestrictionsFactoryUtil.in("bazId", new Object[] { newBazId }));
List<Object> result = _persistence.findWithDynamicQuery(dynamicQuery);
Assert.assertEquals(1, result.size());
Object existingBazId = result.get(0);
Assert.assertEquals(existingBazId, newBazId);
}
use of com.liferay.blade.workflow.basic.model.Baz in project liferay-blade-samples by liferay.
the class BazPersistenceTest method testFetchByPrimaryKeyExisting.
@Test
public void testFetchByPrimaryKeyExisting() throws Exception {
Baz newBaz = addBaz();
Baz existingBaz = _persistence.fetchByPrimaryKey(newBaz.getPrimaryKey());
Assert.assertEquals(existingBaz, newBaz);
}
use of com.liferay.blade.workflow.basic.model.Baz in project liferay-blade-samples by liferay.
the class BazPersistenceTest method testFindByPrimaryKeyExisting.
@Test
public void testFindByPrimaryKeyExisting() throws Exception {
Baz newBaz = addBaz();
Baz existingBaz = _persistence.findByPrimaryKey(newBaz.getPrimaryKey());
Assert.assertEquals(existingBaz, newBaz);
}
use of com.liferay.blade.workflow.basic.model.Baz in project liferay-blade-samples by liferay.
the class BazPersistenceTest method addBaz.
protected Baz addBaz() throws Exception {
long pk = RandomTestUtil.nextLong();
Baz baz = _persistence.create(pk);
baz.setUuid(RandomTestUtil.randomString());
baz.setGroupId(RandomTestUtil.nextLong());
baz.setCompanyId(RandomTestUtil.nextLong());
baz.setUserId(RandomTestUtil.nextLong());
baz.setUserName(RandomTestUtil.randomString());
baz.setCreateDate(RandomTestUtil.nextDate());
baz.setModifiedDate(RandomTestUtil.nextDate());
baz.setStatus(RandomTestUtil.nextInt());
baz.setStatusByUserId(RandomTestUtil.nextLong());
baz.setStatusByUserName(RandomTestUtil.randomString());
baz.setStatusDate(RandomTestUtil.nextDate());
_bazs.add(_persistence.update(baz));
return baz;
}
Aggregations