use of com.liferay.blade.workflow.basic.model.Baz in project liferay-blade-samples by liferay.
the class BazLocalServiceImpl method updateBaz.
@Override
public Baz updateBaz(long bazId, ServiceContext serviceContext) throws PortalException {
Baz baz = bazPersistence.findByPrimaryKey(bazId);
baz.setModifiedDate(serviceContext.getModifiedDate(null));
baz = bazPersistence.update(baz);
WorkflowHandlerRegistryUtil.startWorkflowInstance(baz.getCompanyId(), baz.getGroupId(), baz.getUserId(), Baz.class.getName(), baz.getPrimaryKey(), baz, serviceContext);
return baz;
}
use of com.liferay.blade.workflow.basic.model.Baz in project liferay-blade-samples by liferay.
the class BazPersistenceTest method testCreate.
@Test
public void testCreate() throws Exception {
long pk = RandomTestUtil.nextLong();
Baz baz = _persistence.create(pk);
Assert.assertNotNull(baz);
Assert.assertEquals(baz.getPrimaryKey(), pk);
}
use of com.liferay.blade.workflow.basic.model.Baz in project liferay-blade-samples by liferay.
the class BazPersistenceTest method testFetchByPrimaryKeysWithOnePrimaryKey.
@Test
public void testFetchByPrimaryKeysWithOnePrimaryKey() throws Exception {
Baz newBaz = addBaz();
Set<Serializable> primaryKeys = new HashSet<Serializable>();
primaryKeys.add(newBaz.getPrimaryKey());
Map<Serializable, Baz> bazs = _persistence.fetchByPrimaryKeys(primaryKeys);
Assert.assertEquals(1, bazs.size());
Assert.assertEquals(newBaz, bazs.get(newBaz.getPrimaryKey()));
}
use of com.liferay.blade.workflow.basic.model.Baz in project liferay-blade-samples by liferay.
the class BazPersistenceTest method testDynamicQueryByPrimaryKeyMissing.
@Test
public void testDynamicQueryByPrimaryKeyMissing() throws Exception {
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Baz.class, _dynamicQueryClassLoader);
dynamicQuery.add(RestrictionsFactoryUtil.eq("bazId", RandomTestUtil.nextLong()));
List<Baz> result = _persistence.findWithDynamicQuery(dynamicQuery);
Assert.assertEquals(0, result.size());
}
use of com.liferay.blade.workflow.basic.model.Baz in project liferay-blade-samples by liferay.
the class BazPersistenceTest method testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereSomePrimaryKeysExist.
@Test
public void testFetchByPrimaryKeysWithMultiplePrimaryKeysWhereSomePrimaryKeysExist() throws Exception {
Baz newBaz = addBaz();
long pk = RandomTestUtil.nextLong();
Set<Serializable> primaryKeys = new HashSet<Serializable>();
primaryKeys.add(newBaz.getPrimaryKey());
primaryKeys.add(pk);
Map<Serializable, Baz> bazs = _persistence.fetchByPrimaryKeys(primaryKeys);
Assert.assertEquals(1, bazs.size());
Assert.assertEquals(newBaz, bazs.get(newBaz.getPrimaryKey()));
}
Aggregations