Subversion Repositories SmartDukaan

Rev

Rev 35079 | Rev 35082 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package com.spice.profitmandi.dao.entity.auth;

import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalTime;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

import com.spice.profitmandi.dao.convertor.LocalDateTimeAttributeConverter;

@Entity
@Table(name = "auth.location_tracking")
public class LocationTracking {

    @Id
    @Column(name = "id", columnDefinition = "int(11)")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;

    @Column(name = "user_id", nullable = false)
    private int userId;

    @Column(name = "device_id", nullable = false)
    private String deviceId;

    @Column(name = "task_id", nullable = false)
    private int taskId;

    @Column(name = "checkin_lat_lng", nullable = false, length = 191)
    private String checkInLatLng;

    @Column(name = "checkout_lat_lng", nullable = false, length = 191)
    private String checkOutLatLng;

    @Column(name = "task_date", nullable = false)
    private LocalDate taskDate;

    @Column(name = "task_name", nullable = false, length = 191)
    private String taskName;

    @Column(name = "mark_type", nullable = false, length = 191)
    private String markType;

    @Column(name = "check_in_time", nullable = true, length = 20)
    private LocalTime checkInTime;

    @Column(name = "check_out_time", nullable = true, length = 20)
    private LocalTime checkOutTime;

    @Column(name = "transit_time", nullable = true, length = 20)
    private LocalTime transitTime;

    @Column(name = "time_spent", nullable = true, length = 20)
    private LocalTime timeSpent;

    @Column(name = "task_type", nullable = false, length = 191)
    private String taskType;

    @Column(name = "session_start_time")
    private LocalTime sessionStartTime;

    @Column(name = "session_end_time")
    private LocalTime sessionEndTime;

    @Column(name = "task_description", columnDefinition = "TEXT")
    private String taskDescription;

    @Column(name = "address", nullable = false, length = 500)
    private String address;

    @Column(name = "attachment", length = 191)
    private String attachment;

    @Column(name = "total_distance", precision = 10, scale = 2)
    private String totalDistance;

    @Column(name = "estimated_time", precision = 10, scale = 2)
    private LocalTime estimatedTime;

    @Column(name = "assigned_by", nullable = false)
    private int assignedBy;

    @Column(name = "status", nullable = false)
    private boolean status;

    @Convert(converter = LocalDateTimeAttributeConverter.class)
    @Column(name = "created_timestamp", nullable = false, updatable = false)
    private LocalDateTime createdTimestamp;

    @Convert(converter = LocalDateTimeAttributeConverter.class)
    @Column(name = "updated_timestamp")
    private LocalDateTime updatedTimestamp;

   // @OneToMany(mappedBy = "locationTracking", cascade = CascadeType.ALL, orphanRemoval = true, fetch = FetchType.LAZY)
    private List<LocationTrackingPath> journeyPath = new ArrayList<>();

    public List<LocationTrackingPath> getJourneyPath() {
        return journeyPath;
    }

    public void setJourneyPath(List<LocationTrackingPath> journeyPath) {
        this.journeyPath = journeyPath;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }

    public int getTaskId() {
        return taskId;
    }

    public void setTaskId(int taskId) {
        this.taskId = taskId;
    }

    public String getCheckInLatLng() {
        return checkInLatLng;
    }

    public void setCheckInLatLng(String checkInLatLng) {
        this.checkInLatLng = checkInLatLng;
    }

    public String getCheckOutLatLng() {
        return checkOutLatLng;
    }

    public void setCheckOutLatLng(String checkOutLatLng) {
        this.checkOutLatLng = checkOutLatLng;
    }

    public LocalDate getTaskDate() {
        return taskDate;
    }

    public void setTaskDate(LocalDate taskDate) {
        this.taskDate = taskDate;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }

    public String getMarkType() {
        return markType;
    }

    public void setMarkType(String markType) {
        this.markType = markType;
    }

    public LocalTime getCheckInTime() {
        return checkInTime;
    }

    public void setCheckInTime(LocalTime checkInTime) {
        this.checkInTime = checkInTime;
    }

    public LocalTime getCheckOutTime() {
        return checkOutTime;
    }

    public void setCheckOutTime(LocalTime checkOutTime) {
        this.checkOutTime = checkOutTime;
    }

    public LocalTime getTransitTime() {
        return transitTime;
    }

    public void setTransitTime(LocalTime transitTime) {
        this.transitTime = transitTime;
    }

    public LocalTime getTimeSpent() {
        return timeSpent;
    }

    public void setTimeSpent(LocalTime timeSpent) {
        this.timeSpent = timeSpent;
    }

    public String getTaskType() {
        return taskType;
    }

    public void setTaskType(String taskType) {
        this.taskType = taskType;
    }

    public LocalTime getSessionStartTime() {
        return sessionStartTime;
    }

    public void setSessionStartTime(LocalTime sessionStartTime) {
        this.sessionStartTime = sessionStartTime;
    }

    public LocalTime getSessionEndTime() {
        return sessionEndTime;
    }

    public void setSessionEndTime(LocalTime sessionEndTime) {
        this.sessionEndTime = sessionEndTime;
    }

    public String getTaskDescription() {
        return taskDescription;
    }

    public void setTaskDescription(String taskDescription) {
        this.taskDescription = taskDescription;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getAttachment() {
        return attachment;
    }

    public void setAttachment(String attachment) {
        this.attachment = attachment;
    }

    public String getTotalDistance() {
        return totalDistance;
    }

    public void setTotalDistance(String totalDistance) {
        this.totalDistance = totalDistance;
    }

    public LocalTime getEstimatedTime() {
        return estimatedTime;
    }

    public void setEstimatedTime(LocalTime estimatedTime) {
        this.estimatedTime = estimatedTime;
    }

    public int getAssignedBy() {
        return assignedBy;
    }

    public void setAssignedBy(int assignedBy) {
        this.assignedBy = assignedBy;
    }

    public boolean isStatus() {
        return status;
    }

    public void setStatus(boolean status) {
        this.status = status;
    }

    public LocalDateTime getCreatedTimestamp() {
        return createdTimestamp;
    }

    public void setCreatedTimestamp(LocalDateTime createdTimestamp) {
        this.createdTimestamp = createdTimestamp;
    }

    public LocalDateTime getUpdatedTimestamp() {
        return updatedTimestamp;
    }

    public void setUpdatedTimestamp(LocalDateTime updatedTimestamp) {
        this.updatedTimestamp = updatedTimestamp;
    }

    @Override
    public String toString() {
        return "LocationTracking{" +
                "id=" + id +
                ", userId=" + userId +
                ", deviceId='" + deviceId + '\'' +
                ", taskId=" + taskId +
                ", checkInLatLng='" + checkInLatLng + '\'' +
                ", checkOutLatLng='" + checkOutLatLng + '\'' +
                ", taskDate=" + taskDate +
                ", taskName='" + taskName + '\'' +
                ", markType='" + markType + '\'' +
                ", checkInTime=" + checkInTime +
                ", checkOutTime=" + checkOutTime +
                ", transitTime=" + transitTime +
                ", timeSpent=" + timeSpent +
                ", taskType='" + taskType + '\'' +
                ", sessionStartTime=" + sessionStartTime +
                ", sessionEndTime=" + sessionEndTime +
                ", taskDescription='" + taskDescription + '\'' +
                ", address='" + address + '\'' +
                ", attachment='" + attachment + '\'' +
                ", totalDistance='" + totalDistance + '\'' +
                ", estimatedTime=" + estimatedTime +
                ", assignedBy=" + assignedBy +
                ", status=" + status +
                ", createdTimestamp=" + createdTimestamp +
                ", updatedTimestamp=" + updatedTimestamp +
                '}';
    }
}