Created
April 24, 2014 12:40
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
User user = null; | |
try | |
{ | |
ExpandoColumn column = ExpandoColumnLocalServiceUtil.getDefaultTableColumn(companyId, User.class.getName(), columnName); | |
DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(ExpandoValue.class, PortalClassLoaderUtil.getClassLoader()) | |
.add(PropertyFactoryUtil.forName("columnId").eq(GetterUtil.getLong(column.getColumnId()))).add( | |
PropertyFactoryUtil.forName("data").eq(value)).add( | |
PropertyFactoryUtil.forName("classNameId").eq( | |
GetterUtil.getLong(ClassNameLocalServiceUtil.getClassNameId(User.class.getName())))); | |
List expandoValueList = ExpandoValueLocalServiceUtil.dynamicQuery(dynamicQuery); | |
Iterator i = expandoValueList.iterator(); | |
List<User> userList = new ArrayList<User>(); | |
do | |
{ | |
if (!i.hasNext()) | |
{ | |
break; | |
} | |
ExpandoValue expandoValue = (ExpandoValue) i.next(); | |
if (expandoValue.getClassPK() > 0L) | |
{ | |
user = UserLocalServiceUtil.getUser(expandoValue.getClassPK()); | |
userList.add(user); | |
} | |
} while (true); | |
} catch (Exception e) | |
{ | |
LOGGER.error(e.getMessage(),e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment