Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 17 additions & 18 deletions src/main/java/com/coderscampus/cp/domain/Checkin.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

import java.time.Instant;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

@Entity
public class Checkin {
Expand All @@ -28,6 +30,9 @@ public class Checkin {
@JoinColumn(name = "student_id")
private Student student;

@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private List<Tag> tag = new ArrayList<Tag>();

// ID
public Long getId() {
return id;
Expand Down Expand Up @@ -155,25 +160,19 @@ public String getComment() {
public void setComment(String comment) {
this.comment = comment;
}


public List<Tag> getTag() {
return tag;
}
public void setTag(List<Tag> tag) {
this.tag = tag;
}
@Override
public String toString() {
return "Checkin{" +
"id=" + id +
", uid='" + uid + '\'' +
", date=" + date +
", nextAssignment=" + nextAssignment +
", blockers=" + blockers +
", blockerDescription='" + blockerDescription + '\'' +
", isSetUp=" + isSetUp +
", available=" + available +
", role=" + role +
", startTime=" + startTime +
", endTime=" + endTime +
", codingType=" + codingType +
", issueNumber=" + issueNumber +
", comment='" + comment + '\'' +
", student=" + student +
'}';
return "Checkin [id=" + id + ", uid=" + uid + ", date=" + date + ", nextAssignment=" + nextAssignment
+ ", blockers=" + blockers + ", blockerDescription=" + blockerDescription + ", isSetUp=" + isSetUp
+ ", available=" + available + ", role=" + role + ", startTime=" + startTime + ", endTime=" + endTime
+ ", codingType=" + codingType + ", issueNumber=" + issueNumber + ", comment=" + comment + ", student="
+ student + ", tag=" + tag + "]";
}
}
47 changes: 47 additions & 0 deletions src/main/java/com/coderscampus/cp/domain/Tag.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package com.coderscampus.cp.domain;

import jakarta.persistence.*;

@Entity
public class Tag {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

@Column(nullable = false, unique = true)
private String name;

@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
@JoinColumn(name = "checkin_id")
private Checkin checkin;

public Long getId() {
return id;
}

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

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public Checkin getCheckin() {
return checkin;
}

public void setCheckin(Checkin checkin) {
this.checkin = checkin;
}

@Override
public String toString() {
return "Tag [id=" + id + ", name=" + name + ", checkin=" + checkin + "]";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package com.coderscampus.cp.repository;

import com.coderscampus.cp.domain.Tag;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface TagRepository extends JpaRepository<Tag, Long> {
}
7 changes: 7 additions & 0 deletions src/main/java/com/coderscampus/cp/service/TagService.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package com.coderscampus.cp.service;

import org.springframework.stereotype.Service;

@Service
public class TagService {
}