Created
November 28, 2015 14:32
-
-
Save bmvakili/a4b79b137de73b871e8a to your computer and use it in GitHub Desktop.
Get Liferay DDL Records for a user
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.PrintStream; | |
import java.util.List; | |
import com.liferay.portal.kernel.dao.orm.Criterion; | |
import com.liferay.portal.kernel.dao.orm.DynamicQuery; | |
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; | |
import com.liferay.portal.kernel.exception.SystemException; | |
import com.liferay.portlet.dynamicdatalists.model.DDLRecord; | |
import com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalServiceUtil; | |
Long userId = 50785l; | |
DynamicQuery dynamicQuery = DDLRecordLocalServiceUtil.dynamicQuery(); | |
Criterion criterion = PropertyFactoryUtil.forName("userId").eq(userId); | |
dynamicQuery.add(criterion); | |
List records = DDLRecordLocalServiceUtil.dynamicQuery(dynamicQuery); | |
for (DDLRecord record : records) { | |
out.println(record); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment