Skip to content

Instantly share code, notes, and snippets.

@code-machina
Created April 5, 2019 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save code-machina/8355d35821eeda08833f76692b5283e2 to your computer and use it in GitHub Desktop.
Save code-machina/8355d35821eeda08833f76692b5283e2 to your computer and use it in GitHub Desktop.
Model for Spring DAL
package com.gbkim.student.dal.entities;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
@Entity
@Table(name = "studenttab")
public class Student {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Column(name = "sname")
private String name;
@Column(name = "scourse")
private String course;
@Column(name = "sfee")
private double fee;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getCourse() {
return course;
}
public void setCourse(String course) {
this.course = course;
}
public double getFee() {
return fee;
}
public void setFee(double fee) {
this.fee = fee;
}
@Override
public String toString() {
return "Student [id=" + id + ", name=" + name + ", course=" + course + ", fee=" + fee + "]";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment