Package me.victorhernandez.hellospring.domain

Examples of me.victorhernandez.hellospring.domain.Task


 
  @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.Task

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.