Пример #1
0
  private UserVariable create(User user, UserVariableKey key, String value) {
    EntityManager entityManager = getEntityManager();

    UserVariable userVariable = new UserVariable();
    userVariable.setUser(user);
    userVariable.setKey(key);
    userVariable.setValue(value);
    entityManager.persist(userVariable);

    user.getVariables().add(userVariable);
    entityManager.persist(user);

    return userVariable;
  }
Пример #2
0
 private void updateValue(UserVariable userVariable, String value) {
   EntityManager entityManager = getEntityManager();
   userVariable.setValue(value);
   entityManager.persist(userVariable);
 }