use of net.geoprism.registry.UserInfoQuery in project geoprism-registry by terraframe.
the class UserInfoPatch method doIt.
@Transaction
private void doIt() {
UserInfoQuery query = new UserInfoQuery(new QueryFactory());
try (OIterator<? extends UserInfo> it = query.getIterator()) {
while (it.hasNext()) {
UserInfo info = it.next();
info.appLock();
info.apply();
}
}
// Ensure all geoprism users have a user info
GeoprismUserQuery gQuery = new GeoprismUserQuery(new QueryFactory());
try (OIterator<? extends GeoprismUser> it = gQuery.getIterator()) {
while (it.hasNext()) {
GeoprismUser user = it.next();
UserInfo info = UserInfo.getByUser(user);
if (info == null) {
info = new UserInfo();
info.setGeoprismUser(user);
info.apply();
}
}
}
}
Aggregations