Package me.victorhernandez.hellospring.domain

Examples of me.victorhernandez.hellospring.domain.Usuario


  private Usuario user;

 
  public RegistrarBean() {
   
    user = new Usuario();
  }
View Full Code Here


  }
 
  @Transactional
  public void assignTaskToUser(long userId, long taskId) {
    //1.0 obtener los objetos a relacionar.
    Usuario user = userDao.get(userId);
    Task task = taskDao.get(taskId);
    //2. relacionarlos
    user.getTasks().add(task);
    task.getAsignedUser().add(user);
    //3. será que necesito salvar
    userDao.save(user);
    taskDao.save(task);
  }
View Full Code Here

  }
 
  @Transactional
  public void removeTaskFromUser(long taskId, long userId){
    //1.0 obtener los objetos a relacionar.
    Usuario user = userDao.get(userId);
    Task task = taskDao.get(taskId);
    user.getTasks().remove(task);
    task.getAsignedUser().remove(user);
    userDao.save(user);
    taskDao.save(task);
  }
View Full Code Here

TOP

Related Classes of me.victorhernandez.hellospring.domain.Usuario

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.