Add outline of activity class, has bugs

This commit is contained in:
Merel Steenbergen
2019-03-14 14:04:04 +01:00
parent dc6682d7fa
commit 5f4069fcad
2 changed files with 15 additions and 4 deletions

View File

@@ -6,17 +6,26 @@ import lombok.NoArgsConstructor;
import javax.accessibility.AccessibleValue;
import javax.persistence.*;
import java.util.Objects;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Scanner;
@Entity
@Data
@Table(name = "activities")
//@AllArgsConstructor
public class Activity {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
long id;
//@AllArgsConstructor
public abstract class Activity {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
Long id;
String name;
String description;
int score;
@@ -39,7 +48,8 @@ public class Activity {
* gets the id.
* @return the id
*/
public long getId() {
public Long getId() {
return id;
}
@@ -72,7 +82,7 @@ public class Activity {
* sets the id.
* @param id the you want to assign to this.id.
*/
public void setId(long id) {
public void setId(Long id) {
this.id = id;
}
@@ -100,7 +110,6 @@ public class Activity {
this.score = score;
}
/**
* Returns a human readable object. It's in JSON.
* @return the JSON form of the object.
@@ -131,4 +140,5 @@ public class Activity {
public int hashCode() {
return Objects.hash(id, name, description, score);
}
}

View File

@@ -11,6 +11,7 @@ import java.util.Objects;
@Entity
@Data
@Table(name = "users")
public class User {
@Id