@Override
public synchronized void setDefaultStoryView(String userId, FilterSpec defaultView) {
PersistenceManager pm = PMF.get().getPersistenceManager();
try {
UserEntity userInfo = pm.getObjectById(UserEntity.class, createKey(userId));
userInfo.setDefaultLspView(defaultView.getFilterParams());
pm.makePersistent(userInfo);
} catch (JDOObjectNotFoundException e) {
UserEntity userInfo = new UserEntity();
userInfo.setEmailAddress(userId);
userInfo.setDefaultLspView(defaultView.getFilterParams());
pm.makePersistent(userInfo);
} finally {
pm.close();
}
}