// Path: src/main/java/com/mpalourdio/springboottemplate/model/Dummy.java
// public class Dummy {
// 
//     public String name;
//     @JsonIgnore
//     public String desc;
// 
//     public Dummy(String name, String desc) {
//         this.name = name;
//         this.desc = desc;
//     }
// }
// 
// Path: src/main/java/com/mpalourdio/springboottemplate/model/entities/Task.java
// @Entity
// @Table(name = "task_list")
// public class Task {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "task_list_task_id_seq")
//     @Column(name = "task_id")
//     private int id;
// 
//     @Column(name = "task_name", nullable = false)
//     private String taskName;
// 
//     @Column(name = "task_description", nullable = false)
//     private String taskDescription;
// 
//     @Column(name = "task_priority", nullable = false)
//     private String taskPriority;
// 
//     @Column(name = "task_status", nullable = false)
//     private String taskStatus;
// 
//     @ColumnDefault("false")
//     @Column(name = "task_archived", nullable = false)
//     private Boolean taskArchived = false;
// 
//     @ColumnDefault(CurrentTimestampFunction.NAME)
//     @Column(name = "start_date", nullable = false)
//     private LocalDateTime startDate = LocalDateTime.now();
// 
//     @OneToMany(mappedBy = "task")
//     private List<People> people = new ArrayList<>();
// 
//     public String getTaskName() {
//         return taskName;
//     }
// 
//     public void setTaskName(String taskName) {
//         this.taskName = taskName;
//     }
// 
//     public String getTaskDescription() {
//         return taskDescription;
//     }
// 
//     public void setTaskDescription(String taskDescription) {
//         this.taskDescription = taskDescription;
//     }
// 
//     public String getTaskPriority() {
//         return taskPriority;
//     }
// 
//     public void setTaskPriority(String taskPriority) {
//         this.taskPriority = taskPriority;
//     }
// 
//     public String getTaskStatus() {
//         return taskStatus;
//     }
// 
//     public void setTaskStatus(String taskStatus) {
//         this.taskStatus = taskStatus;
//     }
// 
//     public Boolean isTaskArchived() {
//         return taskArchived;
//     }
// 
//     public void setTaskArchived(Boolean taskArchived) {
//         this.taskArchived = taskArchived;
//     }
// 
//     public List<People> getPeople() {
//         return people;
//     }
// 
//     public void setPeople(List<People> people) {
//         this.people = people;
//     }
// 
// 
//     public LocalDateTime getStartDate() {
//         return startDate;
//     }
// 
//     public void setStartDate(LocalDateTime startDate) {
//         this.startDate = startDate;
//     }
// 
//     @Override
//     public String toString() {
//         return "Task [id=" + id + ", taskName=" + taskName
//                 + ", taskDescription=" + taskDescription + ", taskPriority="
//                 + taskPriority + ",taskStatus=" + taskStatus + "]";
//     }
// }


import com.mpalourdio.springboottemplate.model.Dummy;
import com.mpalourdio.springboottemplate.model.entities.Task;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.util.List;
/*
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.mpalourdio.springboottemplate.model.repositories;



/**
 * This implementation MUST have the 'impl'
 * suffix in order to be discovered !
 */

public class TaskRepositoryImpl implements CustomRepository<Task> {

    @PersistenceContext
    private EntityManager entityManager;

    @Override
    public List<Task> customFindByPriority(String priority) {
        return entityManager
                .createQuery("select e from Task e where e.taskPriority = :taskPriority", Task.class)
                .setParameter("taskPriority", priority)
                .getResultList();
    }

    @Override
// Path: src/main/java/com/mpalourdio/springboottemplate/model/Dummy.java
// public class Dummy {
// 
//     public String name;
//     @JsonIgnore
//     public String desc;
// 
//     public Dummy(String name, String desc) {
//         this.name = name;
//         this.desc = desc;
//     }
// }
// 
// Path: src/main/java/com/mpalourdio/springboottemplate/model/entities/Task.java
// @Entity
// @Table(name = "task_list")
// public class Task {
// 
//     @Id
//     @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "task_list_task_id_seq")
//     @Column(name = "task_id")
//     private int id;
// 
//     @Column(name = "task_name", nullable = false)
//     private String taskName;
// 
//     @Column(name = "task_description", nullable = false)
//     private String taskDescription;
// 
//     @Column(name = "task_priority", nullable = false)
//     private String taskPriority;
// 
//     @Column(name = "task_status", nullable = false)
//     private String taskStatus;
// 
//     @ColumnDefault("false")
//     @Column(name = "task_archived", nullable = false)
//     private Boolean taskArchived = false;
// 
//     @ColumnDefault(CurrentTimestampFunction.NAME)
//     @Column(name = "start_date", nullable = false)
//     private LocalDateTime startDate = LocalDateTime.now();
// 
//     @OneToMany(mappedBy = "task")
//     private List<People> people = new ArrayList<>();
// 
//     public String getTaskName() {
//         return taskName;
//     }
// 
//     public void setTaskName(String taskName) {
//         this.taskName = taskName;
//     }
// 
//     public String getTaskDescription() {
//         return taskDescription;
//     }
// 
//     public void setTaskDescription(String taskDescription) {
//         this.taskDescription = taskDescription;
//     }
// 
//     public String getTaskPriority() {
//         return taskPriority;
//     }
// 
//     public void setTaskPriority(String taskPriority) {
//         this.taskPriority = taskPriority;
//     }
// 
//     public String getTaskStatus() {
//         return taskStatus;
//     }
// 
//     public void setTaskStatus(String taskStatus) {
//         this.taskStatus = taskStatus;
//     }
// 
//     public Boolean isTaskArchived() {
//         return taskArchived;
//     }
// 
//     public void setTaskArchived(Boolean taskArchived) {
//         this.taskArchived = taskArchived;
//     }
// 
//     public List<People> getPeople() {
//         return people;
//     }
// 
//     public void setPeople(List<People> people) {
//         this.people = people;
//     }
// 
// 
//     public LocalDateTime getStartDate() {
//         return startDate;
//     }
// 
//     public void setStartDate(LocalDateTime startDate) {
//         this.startDate = startDate;
//     }
// 
//     @Override
//     public String toString() {
//         return "Task [id=" + id + ", taskName=" + taskName
//                 + ", taskDescription=" + taskDescription + ", taskPriority="
//                 + taskPriority + ",taskStatus=" + taskStatus + "]";
//     }
// }


// Path: src/main/java/com/mpalourdio/springboottemplate/model/repositories/TaskRepositoryImpl.java
import com.mpalourdio.springboottemplate.model.Dummy;
import com.mpalourdio.springboottemplate.model.entities.Task;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import java.util.List;

/*
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.mpalourdio.springboottemplate.model.repositories;



/**
 * This implementation MUST have the 'impl'
 * suffix in order to be discovered !
 */

public class TaskRepositoryImpl implements CustomRepository<Task> {

    @PersistenceContext
    private EntityManager entityManager;

    @Override
    public List<Task> customFindByPriority(String priority) {
        return entityManager
                .createQuery("select e from Task e where e.taskPriority = :taskPriority", Task.class)
                .setParameter("taskPriority", priority)
                .getResultList();
    }

    @Override
    public List<Dummy> hydrateDummyObject() {