// Path: src/main/java/com/getit/todoapp/repository/TodoRepository.java
// @Repository
// @RooJpaRepository(domainType = Todo.class)
// public interface TodoRepository extends JpaSpecificationExecutor<Todo>, JpaRepository<Todo, Long> {
// 	
// 	@Query("select t from Todo t where t.userName.userName = ?1")
// 	List<Todo> findTodosByUserName(String userName);
// 	
// 	@Query("select t from Todo t where t.userName.userName = ?1 and t.id= ?2")
// 	Todo findTodoByUserNameAndId(String userName,Long id);
// }
// 
// Path: src/main/java/com/getit/todoapp/service/TodoService.java
// @RooService(domainTypes = { com.getit.todoapp.domain.Todo.class })
// public interface TodoService {
// 
// 	public abstract long countAllTodoes();
// 
// 
// 	public abstract void deleteTodo(Todo todo);
// 
// 
// 	public abstract Todo findTodo(Long id);
// 
// 
// 	public abstract List<Todo> findAllTodoes();
// 
// 
// 	public abstract List<Todo> findTodoEntries(int firstResult, int maxResults);
// 
// 
// 	public abstract void saveTodo(Todo todo);
// 
// 
// 	public abstract Todo updateTodo(Todo todo);
// 
// 	public abstract List<Todo> findTodosByUserName(String userName);
// 	
// 	public abstract Todo findTodoByUserNameAndId(String userName,Long id);
// }


import com.getit.todoapp.repository.TodoRepository;
import com.getit.todoapp.service.TodoService;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.roo.addon.dod.RooDataOnDemand;
import org.springframework.stereotype.Component;
package com.getit.todoapp.domain;

@Component
@Configurable
@RooDataOnDemand(entity = Todo.class)
public class TodoDataOnDemand {

	private Random rnd = new SecureRandom();

	private List<Todo> data;

	@Autowired
    UserinfoDataOnDemand userinfoDataOnDemand;

	@Autowired
    TodoService todoService;

	@Autowired
    TodoRepository todoRepository;

	public Todo getNewTransientTodo(int index) {
        Todo obj = new Todo();
        setIsCompleted(obj, index);
        setName(obj, index);
        setPriority(obj, index);
        setTargetDate(obj, index);
        return obj;
    }

	public void setIsCompleted(Todo obj, int index) {
        Boolean isCompleted = Boolean.TRUE;
// Path: src/main/java/com/getit/todoapp/repository/TodoRepository.java
// @Repository
// @RooJpaRepository(domainType = Todo.class)
// public interface TodoRepository extends JpaSpecificationExecutor<Todo>, JpaRepository<Todo, Long> {
// 	
// 	@Query("select t from Todo t where t.userName.userName = ?1")
// 	List<Todo> findTodosByUserName(String userName);
// 	
// 	@Query("select t from Todo t where t.userName.userName = ?1 and t.id= ?2")
// 	Todo findTodoByUserNameAndId(String userName,Long id);
// }
// 
// Path: src/main/java/com/getit/todoapp/service/TodoService.java
// @RooService(domainTypes = { com.getit.todoapp.domain.Todo.class })
// public interface TodoService {
// 
// 	public abstract long countAllTodoes();
// 
// 
// 	public abstract void deleteTodo(Todo todo);
// 
// 
// 	public abstract Todo findTodo(Long id);
// 
// 
// 	public abstract List<Todo> findAllTodoes();
// 
// 
// 	public abstract List<Todo> findTodoEntries(int firstResult, int maxResults);
// 
// 
// 	public abstract void saveTodo(Todo todo);
// 
// 
// 	public abstract Todo updateTodo(Todo todo);
// 
// 	public abstract List<Todo> findTodosByUserName(String userName);
// 	
// 	public abstract Todo findTodoByUserNameAndId(String userName,Long id);
// }


// Path: src/test/java/com/getit/todoapp/domain/TodoDataOnDemand.java
import com.getit.todoapp.repository.TodoRepository;
import com.getit.todoapp.service.TodoService;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Iterator;
import java.util.List;
import java.util.Random;
import javax.validation.ConstraintViolation;
import javax.validation.ConstraintViolationException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.roo.addon.dod.RooDataOnDemand;
import org.springframework.stereotype.Component;

package com.getit.todoapp.domain;

@Component
@Configurable
@RooDataOnDemand(entity = Todo.class)
public class TodoDataOnDemand {

	private Random rnd = new SecureRandom();

	private List<Todo> data;

	@Autowired
    UserinfoDataOnDemand userinfoDataOnDemand;

	@Autowired
    TodoService todoService;

	@Autowired
    TodoRepository todoRepository;

	public Todo getNewTransientTodo(int index) {
        Todo obj = new Todo();
        setIsCompleted(obj, index);
        setName(obj, index);
        setPriority(obj, index);
        setTargetDate(obj, index);
        return obj;
    }

	public void setIsCompleted(Todo obj, int index) {
        Boolean isCompleted = Boolean.TRUE;
        obj.setIsCompleted(isCompleted);