Skip to product information
1 of 6

My Store

5 in 1 handheld cleaning brush

5 in 1 handheld cleaning brush

Regular price Rs. 799.00
Regular price Rs. 1,299.00 Sale price Rs. 799.00
Sale Sold out
Taxes included.
package sdj;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class MainApplication {

    public static void main(String[] args) {
        SpringApplication.run(MainApplication.class, args);
    }

}

package sdj.repository;

import org.springframework.data.jpa.repository.JpaRepository;

import sdj.entity.Student;

public interface StudentRepository extends JpaRepository<Student, Long> {

}


package sdj.entity;

import java.io.Serializable;

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

@Entity
public class Student implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;
   
    @Column(nullable=false)
    private String name;
   
    @Column(name="enrollment_id", nullable=false, unique=true)
    private String enrollmentId;

    public Student() {}
    public Student(String name, String enrollmentId) {
        this.name = name;
        this.enrollmentId = enrollmentId;
    }
   
    public Long getId() {
        return id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
   
    @Override
    public String toString() {
        return "Student [id=" + id + ", name=" + name + ", enrollmentId=" + enrollmentId + "]";
    }
   
}

View full details