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