Package org.jboss.seam.example.tasks.entity

Examples of org.jboss.seam.example.tasks.entity.Task


   }

   @Override
   public Task getEntity(Long id)
   {
      Task task = super.getEntity(id);
      if (!task.getCategory().getName().equals(categoryName) || !task.getOwner().getUsername().equals(user.getUsername()))
      {
         throw new ResourceNotFoundException("Task not found");
      }
      if (!task.isResolved() == isResolved())
      {
         throw new ResourceNotFoundException("Task found, but in different state.");
      }
      return task;
   }
View Full Code Here


   }

   @Override
   public void updateEntity(Task entity, Long id)
   {
      Task task = super.getEntity(id);
      task.setCategory(categoryHome.findByUsernameAndCategory(user.getUsername(), categoryName));
      task.setResolved(isResolved());
      if (entity.getName() != null)
      {
         task.setName(entity.getName());
      }
      if (isResolved())
      {
         task.setUpdated(new Date());
      }
      taskHome.update();
   }
View Full Code Here

TOP

Related Classes of org.jboss.seam.example.tasks.entity.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.