Spring Boot Masterclass – Create an entity class for Expense 05

Hello, in this post we will create an entity class for Expense. let’s begin. Create a class Expense under src/main/java/in/bushansirgur/expenseyoutube/model package

We will use Lombok annotations @Setter, @Getter to override the setters and getters and @ToString to override the toString() method.


package in.bushansirgur.expenseyoutube.model;

import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

public class Expense {
	private Long id;
	private String expensename;
	private BigDecimal amount;
	private String note;
	private Long createdAt;

Bushan SC

About the author

Bushan Sirgur

Hey guys, I am Bushan Sirgur from Banglore, India. Currently, I am working as an Associate project in an IT company.

View all posts

Leave a Reply

Your email address will not be published. Required fields are marked *