Skip to content
Snippets Groups Projects
Commit b8b2fc6e authored by Anders Austlid's avatar Anders Austlid
Browse files

Added Lombok annotations to existing entities

parent 4c02dd48
No related branches found
No related tags found
No related merge requests found
......@@ -8,5 +8,5 @@
</list>
</option>
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_19" project-jdk-name="openjdk-20" project-jdk-type="JavaSDK" />
<component name="ProjectRootManager" version="2" languageLevel="JDK_X" default="true" project-jdk-name="openjdk-20" project-jdk-type="JavaSDK" />
</project>
\ No newline at end of file
......@@ -3,17 +3,25 @@ package ntnu.idatt2016.v233.SmartMat.entity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Id;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* This is a record class representing an allergy
* Allergy is an entity class representing an allergy
*
* @author Stian Lyng
* @version 1.1
* @author Stian Lyng and Anders
* @version 1.1.001
* @since 19.04.2023
*
* @param name The name of the allergy
* @param description The description of the allergy
*/
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity(name = "allergy")
@Data
public class Allergy{
@Id
......
package ntnu.idatt2016.v233.SmartMat.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* Fridge is a record class representing a fridge in the system.
* Fridge is an entity class representing a fridge in the system.
*
* @author Anders
* @version 1.1
* @since 05.04.2023
* @version 1.1.001
* @since 19.04.2023
*
* @param fridgeId
* @param groupId
*/
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity(name = "fridge")
@Data
public class Fridge{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
......
package ntnu.idatt2016.v233.SmartMat.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* Recipe is a record class representing a recipe in the system.
* Recipe is an entity class representing a recipe in the system.
*
* @author Anders
* @version 1.0
* @since 04.04.2023
* @version 1.0.001
* @since 19.04.2023
*
* @param id
* @param name
* @param description
*/
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity(name = "recipe")
@Data
public class Recipe {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
......
......@@ -2,17 +2,25 @@ package ntnu.idatt2016.v233.SmartMat.entity;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* This class represents a shopping list
*
* @author Stian Lyng
* @version 1.0
* @author Stian Lyng and Anders
* @version 1.0.001
* @since 19.04.2023
*
* @param ShoppingListID the id of the shopping list
* @param GroupID the id of the groupID
*/
@Entity
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity(name = "shoppinglist")
@Data
public class ShoppingList {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
......
......@@ -6,15 +6,18 @@ import jakarta.persistence.Id;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* Product is a record class representing a product in the system.
* Product is an entity class representing a product in the system.
* All other info about the product is fetched from api call on fronted.
* this ensures that the product is always up to date.
* @author Birk
* @version 1.1
* @since 05.04.2023
* @author Birk and Anders
* @version 1.1.001
* @since 19.04.2023
*/
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Entity(name = "product")
@Data
......
......@@ -5,7 +5,7 @@ package ntnu.idatt2016.v233.SmartMat.entity.request;
*
* @author Anders
* @version 1.0
* @since 04.04.2023
* @since 18.04.2023
*
* @param username
* @param password
......
......@@ -5,10 +5,8 @@ package ntnu.idatt2016.v233.SmartMat.entity.user;
*
* @author Birk
* @version 2.0
* @since 05.04.2023
* @since 19.04.2023
*
* @param username The username of the user.
* @param authority The authority of the user.
*/
public enum Authority{
USER,
......
......@@ -2,7 +2,9 @@ package ntnu.idatt2016.v233.SmartMat.entity.user;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.authority.SimpleGrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
......@@ -15,13 +17,14 @@ import java.util.List;
* It implements the UserDetails interface.
*
* @author Anders and Birk
* @version 2.0
* @since 05.04.2023
* @version 2.0.001
* @since 19.04.2023
*
*/
@NoArgsConstructor
@AllArgsConstructor
@Entity(name = "users")
@Builder
public class User implements UserDetails {
@Id
@Column(name = "user_name")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment