Search in sources :

Example 1 with Qux

use of com.liferay.blade.workflow.asset.model.Qux in project liferay-blade-samples by liferay.

the class QuxModelImpl method toString.

@Override
public String toString() {
    Map<String, Function<Qux, Object>> attributeGetterFunctions = getAttributeGetterFunctions();
    StringBundler sb = new StringBundler(4 * attributeGetterFunctions.size() + 2);
    sb.append("{");
    for (Map.Entry<String, Function<Qux, Object>> entry : attributeGetterFunctions.entrySet()) {
        String attributeName = entry.getKey();
        Function<Qux, Object> attributeGetterFunction = entry.getValue();
        sb.append(attributeName);
        sb.append("=");
        sb.append(attributeGetterFunction.apply((Qux) this));
        sb.append(", ");
    }
    if (sb.index() > 1) {
        sb.setIndex(sb.index() - 1);
    }
    sb.append("}");
    return sb.toString();
}
Also used : Function(java.util.function.Function) Qux(com.liferay.blade.workflow.asset.model.Qux) HashMap(java.util.HashMap) LinkedHashMap(java.util.LinkedHashMap) Map(java.util.Map) StringBundler(com.liferay.petra.string.StringBundler)

Example 2 with Qux

use of com.liferay.blade.workflow.asset.model.Qux in project liferay-blade-samples by liferay.

the class QuxLocalServiceImpl method updateStatus.

@Override
public Qux updateStatus(long userId, long quxId, int status) throws PortalException {
    User user = userLocalService.getUser(userId);
    Qux qux = getQux(quxId);
    qux.setStatus(status);
    qux.setStatusByUserId(user.getUserId());
    qux.setStatusByUserName(user.getFullName());
    qux.setStatusDate(new Date());
    return updateQux(qux);
}
Also used : User(com.liferay.portal.kernel.model.User) Qux(com.liferay.blade.workflow.asset.model.Qux) Date(java.util.Date)

Example 3 with Qux

use of com.liferay.blade.workflow.asset.model.Qux in project liferay-blade-samples by liferay.

the class QuxLocalServiceImpl method deleteQux.

@Override
public Qux deleteQux(long quxId) throws PortalException {
    Qux qux = quxPersistence.remove(quxId);
    assetEntryLocalService.deleteEntry(Qux.class.getName(), quxId);
    workflowInstanceLinkLocalService.deleteWorkflowInstanceLinks(qux.getCompanyId(), qux.getGroupId(), Qux.class.getName(), qux.getPrimaryKey());
    return qux;
}
Also used : Qux(com.liferay.blade.workflow.asset.model.Qux)

Example 4 with Qux

use of com.liferay.blade.workflow.asset.model.Qux in project liferay-blade-samples by liferay.

the class QuxPersistenceTest method testFetchByPrimaryKeyExisting.

@Test
public void testFetchByPrimaryKeyExisting() throws Exception {
    Qux newQux = addQux();
    Qux existingQux = _persistence.fetchByPrimaryKey(newQux.getPrimaryKey());
    Assert.assertEquals(existingQux, newQux);
}
Also used : Qux(com.liferay.blade.workflow.asset.model.Qux) Test(org.junit.Test)

Example 5 with Qux

use of com.liferay.blade.workflow.asset.model.Qux in project liferay-blade-samples by liferay.

the class QuxPersistenceTest method testResetOriginalValues.

@Test
public void testResetOriginalValues() throws Exception {
    Qux newQux = addQux();
    _persistence.clearCache();
    Qux existingQux = _persistence.findByPrimaryKey(newQux.getPrimaryKey());
    Assert.assertTrue(Objects.equals(existingQux.getUuid(), ReflectionTestUtil.invoke(existingQux, "getOriginalUuid", new Class<?>[0])));
    Assert.assertEquals(Long.valueOf(existingQux.getGroupId()), ReflectionTestUtil.<Long>invoke(existingQux, "getOriginalGroupId", new Class<?>[0]));
}
Also used : Qux(com.liferay.blade.workflow.asset.model.Qux) Test(org.junit.Test)

Aggregations

Qux (com.liferay.blade.workflow.asset.model.Qux)39 Test (org.junit.Test)14 StringBundler (com.liferay.petra.string.StringBundler)13 NoSuchQuxException (com.liferay.blade.workflow.asset.exception.NoSuchQuxException)12 Session (com.liferay.portal.kernel.dao.orm.Session)7 Query (com.liferay.portal.kernel.dao.orm.Query)6 ActionableDynamicQuery (com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery)5 QueryPos (com.liferay.portal.kernel.dao.orm.QueryPos)5 QuxImpl (com.liferay.blade.workflow.asset.model.impl.QuxImpl)4 DynamicQuery (com.liferay.portal.kernel.dao.orm.DynamicQuery)4 FinderPath (com.liferay.portal.kernel.dao.orm.FinderPath)3 Serializable (java.io.Serializable)3 HashSet (java.util.HashSet)3 User (com.liferay.portal.kernel.model.User)2 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 Map (java.util.Map)2 Function (java.util.function.Function)2 ManifestSummary (com.liferay.exportimport.kernel.lar.ManifestSummary)1 StagedModelDataHandler (com.liferay.exportimport.kernel.lar.StagedModelDataHandler)1