This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<WorkItem> finishedWorkItems = workItemService.findFinishedWorkItemsBetweenStartDateAndEndDate("2016-02-13", "2016-02-20"); | |
System.out.println("---finishedWorkItems---"); | |
finishedWorkItems.forEach(System.out::println); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public List<WorkItem> findFinishedWorkItemsBetweenStartDateAndEndDate(String startDate, String endDate) | |
{ | |
Date startDateInDateFormat = null; | |
Date endDateInDateFormat = null; | |
try | |
{ | |
startDateInDateFormat = new SimpleDateFormat("yyyy-MM-dd").parse(startDate); | |
endDateInDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss").parse(endDate + "T23:59:59"); | |
} | |
catch (ParseException e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package se.grouprich.projectmanagement.repository; | |
import java.util.Date; | |
import java.util.List; | |
import org.springframework.data.jpa.repository.Query; | |
import org.springframework.data.repository.PagingAndSortingRepository; | |
import org.springframework.transaction.annotation.Transactional; | |
import se.grouprich.projectmanagement.model.Team; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package se.grouprich.projectmanagement.config; | |
import javax.persistence.EntityManagerFactory; | |
import javax.sql.DataSource; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.data.auditing.DateTimeProvider; | |
import org.springframework.data.domain.AuditorAware; | |
import org.springframework.data.jpa.repository.config.EnableJpaAuditing; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package se.grouprich.projectmanagement.model.auditing; | |
import org.springframework.data.domain.AuditorAware; | |
public class UsernameAuditorAware implements AuditorAware<String> | |
{ | |
@Override | |
public String getCurrentAuditor() | |
{ | |
return "DefaultUser"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package se.grouprich.projectmanagement.model.auditing; | |
import java.util.Calendar; | |
import java.util.GregorianCalendar; | |
import org.springframework.data.auditing.DateTimeProvider; | |
public class AuditingDateTimeProvider implements DateTimeProvider | |
{ | |
@Override |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package se.grouprich.projectmanagement.model; | |
import java.util.Date; | |
import javax.persistence.Column; | |
import javax.persistence.EntityListeners; | |
import javax.persistence.GeneratedValue; | |
import javax.persistence.Id; | |
import javax.persistence.MappedSuperclass; |