Skip to content

Commit 28baadf

Browse files
feat: Add Map and Lineup models!
1 parent d593daf commit 28baadf

File tree

6 files changed

+82
-2
lines changed

6 files changed

+82
-2
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package com.helper.vavahelper.repositories;
2+
3+
import org.springframework.data.jpa.repository.JpaRepository;
4+
5+
import com.helper.vavahelper.models.Lineups.Lineups;
6+
7+
public interface LineupsRepository extends JpaRepository<Lineups, Long> {
8+
9+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
package com.helper.vavahelper.repositories;
2+
3+
import org.springframework.data.jpa.repository.JpaRepository;
4+
5+
import com.helper.vavahelper.models.Maps.Maps;
6+
7+
public interface MapsRepository extends JpaRepository<Maps, Long> {
8+
9+
10+
}

src/main/java/com/helper/vavahelper/Repositories/SkillsRepository.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44

55
import com.helper.vavahelper.models.Skills.Skills;
66

7-
public interface SkillsRepository extends JpaRepository<Skills, Integer>{
7+
public interface SkillsRepository extends JpaRepository<Skills, Long>{
88

99
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
package com.helper.vavahelper.models.Lineups;
2+
3+
import com.helper.vavahelper.models.Agents.Agents;
4+
import com.helper.vavahelper.models.Maps.Maps;
5+
6+
import jakarta.persistence.*;
7+
import lombok.*;
8+
9+
@Entity
10+
@Table(name = "Lineups")
11+
@Getter
12+
@Setter
13+
@NoArgsConstructor
14+
@AllArgsConstructor
15+
public class Lineups {
16+
17+
@Id
18+
@GeneratedValue(strategy = GenerationType.IDENTITY)
19+
private Long id;
20+
21+
@ManyToOne
22+
@JoinColumn(name = "agent_id", nullable = false)
23+
private Agents agents;
24+
25+
@ManyToOne
26+
@JoinColumn(name = "map_id", nullable = false)
27+
private Maps map;
28+
29+
@Column(columnDefinition = "TEXT")
30+
private String description;
31+
32+
@Column(columnDefinition = "TEXT")
33+
private String videoUrl;
34+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package com.helper.vavahelper.models.Maps;
2+
3+
import jakarta.persistence.*;
4+
import lombok.*;
5+
6+
import java.util.List;
7+
8+
import com.helper.vavahelper.models.Lineups.Lineups;
9+
10+
@Entity
11+
@Table(name = "Maps")
12+
@Getter
13+
@Setter
14+
@NoArgsConstructor
15+
@AllArgsConstructor
16+
public class Maps {
17+
18+
@Id
19+
@GeneratedValue(strategy = GenerationType.IDENTITY)
20+
private Long id;
21+
22+
@Column(unique = true, nullable = false)
23+
private String name;
24+
25+
@OneToMany(mappedBy = "map", cascade = CascadeType.ALL, orphanRemoval = true)
26+
private List<Lineups> lineups;
27+
}

src/main/java/com/helper/vavahelper/models/Skills/Skills.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class Skills {
1313

1414
@Id
1515
@GeneratedValue(strategy = GenerationType.IDENTITY)
16-
private Integer id;
16+
private Long id;
1717

1818
@ManyToOne
1919
@JoinColumn(name = "agente_id", nullable = false)

0 commit comments

Comments
 (0)