How to add student with multiple marks into database using hibernate and javafx
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I'm making hibernate and java project for studies and I need help.
I'm making student database where user can add student, his marks, set lesson group and subject.
When I add student with all these things(lesson group etc.) it's ok, but when I want to set the same student another mark for the same subject in result I have
look here from my phpmyadmin:
I get stucked in this moment and I don't have idea how to solve this problem.
Add Student Button
addButton.setOnAction((ActionEvent event) -> {
if (textFieldStudentName.getText() != null && !TextFieldStudentUserName.getText().isEmpty()) {
int selectedMark = setMark.getSelectionModel().getSelectedIndex();
selectedMark++;
String selectedGroup = (String) setGroup.getSelectionModel().getSelectedItem();
Student student = new Student();
Subject subject = new Subject();
Marks mark = new Marks();
Group group = new Group();
group.setGroup_name(selectedGroup);
mark.setMark(selectedMark);
subject.setSubject_name(subjectField.getText());
student.setName(textFieldStudentName.getText());
student.setUserName(TextFieldStudentUserName.getText());
mark.setStudent(student);
mark.setSubject(subject);
student.setGroup(group);
subjectDAO.create(subject);
groupDAO.create(group);
studentDAO.create(student);
marksDAO.create(mark);
textFieldStudentName.clear();
TextFieldStudentUserName.clear();
subjectField.clear();
}
});
Student Class
@Entity
public class Student implements Serializable {
private static final long serialVersionUID = 4L;
@Id
@GenericGenerator(name = "generator", strategy = "increment")
@GeneratedValue(generator = "generator")
@Column(unique = true)
private int student_id;
@Column(length = 15, nullable = false,name="imie")
private String name;
@Column(length = 15, nullable = false,name="nazwisko")
private String UserName;
@ManyToOne(cascade = CascadeType.MERGE)
@JoinColumn(name = "group_id")
private Group group;
@OneToMany(targetEntity = Marks.class, mappedBy = "student", cascade = CascadeType.REMOVE)
private Set<Marks> marks;
public Student(int student_id, String name, String UserName, Group group, Set<Marks> marks) {
this.student_id = student_id;
this.name = name;
this.UserName = UserName;
this.group = group;
this.marks = marks;
}
public Student(){};
public int getStudent_id() {
return student_id;
}
public void setStudent_id(int student_id) {
this.student_id = student_id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUserName() {
return UserName;
}
public void setUserName(String UserName) {
this.UserName = UserName;
}
public Group getGroup() {
return group;
}
public void setGroup(Group group) {
this.group = group;
}
public Set<Marks> getMarks() {
return marks;
}
public void setMarks(Set<Marks> marks) {
this.marks = marks;
}
public int setMark(int selectedMark) {
return selectedMark;
}
}
Marks Class
@Entity
@Table(name = "Oceny")
public class Marks implements Serializable {
private static final long serialVersionUID = 2L;
@Id
@GenericGenerator(name = "generator", strategy = "increment")
@GeneratedValue(generator = "generator")
@Column(unique = true)
private long ocena_id;
@Column(name = "ocena")
private int mark;
@ManyToOne(cascade = CascadeType.ALL)
@GeneratedValue
@JoinColumn(name = "subject_id")
private Subject subject;
@ManyToOne(cascade = CascadeType.ALL)
@GeneratedValue
@JoinColumn(name = "student_id")
private Student student;
public Marks(long ocena_id, int mark, Subject subject, Student student) {
this.ocena_id = ocena_id;
this.mark = mark;
this.subject = subject;
this.student = student;
}
public Marks(){};
public long getOcena_id() {
return ocena_id;
}
public void setOcena_id(long ocena_id) {
this.ocena_id = ocena_id;
}
public int getMark() {
return mark;
}
public void setMark(int mark) {
this.mark = mark;
}
public Subject getSubject() {
return subject;
}
public void setSubject(Subject subject) {
this.subject = subject;
}
public Student getStudent() {
return student;
}
public void setStudent(Student student) {
this.student = student;
}
I except to see XYZ with multiple marks and no duplications for subject, lesson group and student.
how I want to see in database
I made this manually in simple class,but I need to do this in javafx
public class ProjektPORun {
public static void main(String args) {
Student student1=new Student();
student1.setName("Adam");
student1.setUserName("Malysz");
Student student2=new Student();
student2.setName("Robert");
student2.setUserName("Kubica");
Group grupa=new Group();
grupa.setGroup_name("LAB1");
Subject subject=new Subject();
subject.setSubject_name("History");
Marks mark=new Marks();
mark.setMark(1);
Marks mark1=new Marks();
mark1.setMark(2);
Marks mark2=new Marks();
mark2.setMark(3);
student1.setGroup(grupa);
mark.setStudent(student1);
mark1.setStudent(student1);
mark.setSubject(subject);
student2.setGroup(grupa);
mark1.setStudent(student2);
mark2.setStudent(student2);
mark1.setSubject(subject);
mark2.setSubject(subject);
Configuration config = new Configuration().configure("META-INF\hibernate.cfg.xml").addAnnotatedClass(Student.class).addAnnotatedClass(Group.class).addAnnotatedClass(Marks.class).addAnnotatedClass(Subject.class);
ServiceRegistry serviceRegistry=new StandardServiceRegistryBuilder().applySettings(config.getProperties()).build();
SessionFactory factory = config.buildSessionFactory(serviceRegistry);
Session session = factory.openSession();
Transaction transaction = session.beginTransaction();
session.save(student2);
session.save(subject);
session.save(mark);
session.save(mark1);
session.save(mark2);
session.save(grupa);
session.save(student1);
transaction.commit();
session.close();
factory.close();
StandardServiceRegistryBuilder.destroy(serviceRegistry);
}
}
java database hibernate javafx
add a comment |
I'm making hibernate and java project for studies and I need help.
I'm making student database where user can add student, his marks, set lesson group and subject.
When I add student with all these things(lesson group etc.) it's ok, but when I want to set the same student another mark for the same subject in result I have
look here from my phpmyadmin:
I get stucked in this moment and I don't have idea how to solve this problem.
Add Student Button
addButton.setOnAction((ActionEvent event) -> {
if (textFieldStudentName.getText() != null && !TextFieldStudentUserName.getText().isEmpty()) {
int selectedMark = setMark.getSelectionModel().getSelectedIndex();
selectedMark++;
String selectedGroup = (String) setGroup.getSelectionModel().getSelectedItem();
Student student = new Student();
Subject subject = new Subject();
Marks mark = new Marks();
Group group = new Group();
group.setGroup_name(selectedGroup);
mark.setMark(selectedMark);
subject.setSubject_name(subjectField.getText());
student.setName(textFieldStudentName.getText());
student.setUserName(TextFieldStudentUserName.getText());
mark.setStudent(student);
mark.setSubject(subject);
student.setGroup(group);
subjectDAO.create(subject);
groupDAO.create(group);
studentDAO.create(student);
marksDAO.create(mark);
textFieldStudentName.clear();
TextFieldStudentUserName.clear();
subjectField.clear();
}
});
Student Class
@Entity
public class Student implements Serializable {
private static final long serialVersionUID = 4L;
@Id
@GenericGenerator(name = "generator", strategy = "increment")
@GeneratedValue(generator = "generator")
@Column(unique = true)
private int student_id;
@Column(length = 15, nullable = false,name="imie")
private String name;
@Column(length = 15, nullable = false,name="nazwisko")
private String UserName;
@ManyToOne(cascade = CascadeType.MERGE)
@JoinColumn(name = "group_id")
private Group group;
@OneToMany(targetEntity = Marks.class, mappedBy = "student", cascade = CascadeType.REMOVE)
private Set<Marks> marks;
public Student(int student_id, String name, String UserName, Group group, Set<Marks> marks) {
this.student_id = student_id;
this.name = name;
this.UserName = UserName;
this.group = group;
this.marks = marks;
}
public Student(){};
public int getStudent_id() {
return student_id;
}
public void setStudent_id(int student_id) {
this.student_id = student_id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUserName() {
return UserName;
}
public void setUserName(String UserName) {
this.UserName = UserName;
}
public Group getGroup() {
return group;
}
public void setGroup(Group group) {
this.group = group;
}
public Set<Marks> getMarks() {
return marks;
}
public void setMarks(Set<Marks> marks) {
this.marks = marks;
}
public int setMark(int selectedMark) {
return selectedMark;
}
}
Marks Class
@Entity
@Table(name = "Oceny")
public class Marks implements Serializable {
private static final long serialVersionUID = 2L;
@Id
@GenericGenerator(name = "generator", strategy = "increment")
@GeneratedValue(generator = "generator")
@Column(unique = true)
private long ocena_id;
@Column(name = "ocena")
private int mark;
@ManyToOne(cascade = CascadeType.ALL)
@GeneratedValue
@JoinColumn(name = "subject_id")
private Subject subject;
@ManyToOne(cascade = CascadeType.ALL)
@GeneratedValue
@JoinColumn(name = "student_id")
private Student student;
public Marks(long ocena_id, int mark, Subject subject, Student student) {
this.ocena_id = ocena_id;
this.mark = mark;
this.subject = subject;
this.student = student;
}
public Marks(){};
public long getOcena_id() {
return ocena_id;
}
public void setOcena_id(long ocena_id) {
this.ocena_id = ocena_id;
}
public int getMark() {
return mark;
}
public void setMark(int mark) {
this.mark = mark;
}
public Subject getSubject() {
return subject;
}
public void setSubject(Subject subject) {
this.subject = subject;
}
public Student getStudent() {
return student;
}
public void setStudent(Student student) {
this.student = student;
}
I except to see XYZ with multiple marks and no duplications for subject, lesson group and student.
how I want to see in database
I made this manually in simple class,but I need to do this in javafx
public class ProjektPORun {
public static void main(String args) {
Student student1=new Student();
student1.setName("Adam");
student1.setUserName("Malysz");
Student student2=new Student();
student2.setName("Robert");
student2.setUserName("Kubica");
Group grupa=new Group();
grupa.setGroup_name("LAB1");
Subject subject=new Subject();
subject.setSubject_name("History");
Marks mark=new Marks();
mark.setMark(1);
Marks mark1=new Marks();
mark1.setMark(2);
Marks mark2=new Marks();
mark2.setMark(3);
student1.setGroup(grupa);
mark.setStudent(student1);
mark1.setStudent(student1);
mark.setSubject(subject);
student2.setGroup(grupa);
mark1.setStudent(student2);
mark2.setStudent(student2);
mark1.setSubject(subject);
mark2.setSubject(subject);
Configuration config = new Configuration().configure("META-INF\hibernate.cfg.xml").addAnnotatedClass(Student.class).addAnnotatedClass(Group.class).addAnnotatedClass(Marks.class).addAnnotatedClass(Subject.class);
ServiceRegistry serviceRegistry=new StandardServiceRegistryBuilder().applySettings(config.getProperties()).build();
SessionFactory factory = config.buildSessionFactory(serviceRegistry);
Session session = factory.openSession();
Transaction transaction = session.beginTransaction();
session.save(student2);
session.save(subject);
session.save(mark);
session.save(mark1);
session.save(mark2);
session.save(grupa);
session.save(student1);
transaction.commit();
session.close();
factory.close();
StandardServiceRegistryBuilder.destroy(serviceRegistry);
}
}
java database hibernate javafx
1
Please provide a Minimal, Complete, and Verifiable example that demonstrates the problem. And unrelated to your problem: please learn java naming conventions and stick to them
– kleopatra
Jan 4 at 16:19
"I want to set the same student another mark for the same subject " so you want to edit a student, rather than adding one.
– c0der
Jan 5 at 5:48
add a comment |
I'm making hibernate and java project for studies and I need help.
I'm making student database where user can add student, his marks, set lesson group and subject.
When I add student with all these things(lesson group etc.) it's ok, but when I want to set the same student another mark for the same subject in result I have
look here from my phpmyadmin:
I get stucked in this moment and I don't have idea how to solve this problem.
Add Student Button
addButton.setOnAction((ActionEvent event) -> {
if (textFieldStudentName.getText() != null && !TextFieldStudentUserName.getText().isEmpty()) {
int selectedMark = setMark.getSelectionModel().getSelectedIndex();
selectedMark++;
String selectedGroup = (String) setGroup.getSelectionModel().getSelectedItem();
Student student = new Student();
Subject subject = new Subject();
Marks mark = new Marks();
Group group = new Group();
group.setGroup_name(selectedGroup);
mark.setMark(selectedMark);
subject.setSubject_name(subjectField.getText());
student.setName(textFieldStudentName.getText());
student.setUserName(TextFieldStudentUserName.getText());
mark.setStudent(student);
mark.setSubject(subject);
student.setGroup(group);
subjectDAO.create(subject);
groupDAO.create(group);
studentDAO.create(student);
marksDAO.create(mark);
textFieldStudentName.clear();
TextFieldStudentUserName.clear();
subjectField.clear();
}
});
Student Class
@Entity
public class Student implements Serializable {
private static final long serialVersionUID = 4L;
@Id
@GenericGenerator(name = "generator", strategy = "increment")
@GeneratedValue(generator = "generator")
@Column(unique = true)
private int student_id;
@Column(length = 15, nullable = false,name="imie")
private String name;
@Column(length = 15, nullable = false,name="nazwisko")
private String UserName;
@ManyToOne(cascade = CascadeType.MERGE)
@JoinColumn(name = "group_id")
private Group group;
@OneToMany(targetEntity = Marks.class, mappedBy = "student", cascade = CascadeType.REMOVE)
private Set<Marks> marks;
public Student(int student_id, String name, String UserName, Group group, Set<Marks> marks) {
this.student_id = student_id;
this.name = name;
this.UserName = UserName;
this.group = group;
this.marks = marks;
}
public Student(){};
public int getStudent_id() {
return student_id;
}
public void setStudent_id(int student_id) {
this.student_id = student_id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUserName() {
return UserName;
}
public void setUserName(String UserName) {
this.UserName = UserName;
}
public Group getGroup() {
return group;
}
public void setGroup(Group group) {
this.group = group;
}
public Set<Marks> getMarks() {
return marks;
}
public void setMarks(Set<Marks> marks) {
this.marks = marks;
}
public int setMark(int selectedMark) {
return selectedMark;
}
}
Marks Class
@Entity
@Table(name = "Oceny")
public class Marks implements Serializable {
private static final long serialVersionUID = 2L;
@Id
@GenericGenerator(name = "generator", strategy = "increment")
@GeneratedValue(generator = "generator")
@Column(unique = true)
private long ocena_id;
@Column(name = "ocena")
private int mark;
@ManyToOne(cascade = CascadeType.ALL)
@GeneratedValue
@JoinColumn(name = "subject_id")
private Subject subject;
@ManyToOne(cascade = CascadeType.ALL)
@GeneratedValue
@JoinColumn(name = "student_id")
private Student student;
public Marks(long ocena_id, int mark, Subject subject, Student student) {
this.ocena_id = ocena_id;
this.mark = mark;
this.subject = subject;
this.student = student;
}
public Marks(){};
public long getOcena_id() {
return ocena_id;
}
public void setOcena_id(long ocena_id) {
this.ocena_id = ocena_id;
}
public int getMark() {
return mark;
}
public void setMark(int mark) {
this.mark = mark;
}
public Subject getSubject() {
return subject;
}
public void setSubject(Subject subject) {
this.subject = subject;
}
public Student getStudent() {
return student;
}
public void setStudent(Student student) {
this.student = student;
}
I except to see XYZ with multiple marks and no duplications for subject, lesson group and student.
how I want to see in database
I made this manually in simple class,but I need to do this in javafx
public class ProjektPORun {
public static void main(String args) {
Student student1=new Student();
student1.setName("Adam");
student1.setUserName("Malysz");
Student student2=new Student();
student2.setName("Robert");
student2.setUserName("Kubica");
Group grupa=new Group();
grupa.setGroup_name("LAB1");
Subject subject=new Subject();
subject.setSubject_name("History");
Marks mark=new Marks();
mark.setMark(1);
Marks mark1=new Marks();
mark1.setMark(2);
Marks mark2=new Marks();
mark2.setMark(3);
student1.setGroup(grupa);
mark.setStudent(student1);
mark1.setStudent(student1);
mark.setSubject(subject);
student2.setGroup(grupa);
mark1.setStudent(student2);
mark2.setStudent(student2);
mark1.setSubject(subject);
mark2.setSubject(subject);
Configuration config = new Configuration().configure("META-INF\hibernate.cfg.xml").addAnnotatedClass(Student.class).addAnnotatedClass(Group.class).addAnnotatedClass(Marks.class).addAnnotatedClass(Subject.class);
ServiceRegistry serviceRegistry=new StandardServiceRegistryBuilder().applySettings(config.getProperties()).build();
SessionFactory factory = config.buildSessionFactory(serviceRegistry);
Session session = factory.openSession();
Transaction transaction = session.beginTransaction();
session.save(student2);
session.save(subject);
session.save(mark);
session.save(mark1);
session.save(mark2);
session.save(grupa);
session.save(student1);
transaction.commit();
session.close();
factory.close();
StandardServiceRegistryBuilder.destroy(serviceRegistry);
}
}
java database hibernate javafx
I'm making hibernate and java project for studies and I need help.
I'm making student database where user can add student, his marks, set lesson group and subject.
When I add student with all these things(lesson group etc.) it's ok, but when I want to set the same student another mark for the same subject in result I have
look here from my phpmyadmin:
I get stucked in this moment and I don't have idea how to solve this problem.
Add Student Button
addButton.setOnAction((ActionEvent event) -> {
if (textFieldStudentName.getText() != null && !TextFieldStudentUserName.getText().isEmpty()) {
int selectedMark = setMark.getSelectionModel().getSelectedIndex();
selectedMark++;
String selectedGroup = (String) setGroup.getSelectionModel().getSelectedItem();
Student student = new Student();
Subject subject = new Subject();
Marks mark = new Marks();
Group group = new Group();
group.setGroup_name(selectedGroup);
mark.setMark(selectedMark);
subject.setSubject_name(subjectField.getText());
student.setName(textFieldStudentName.getText());
student.setUserName(TextFieldStudentUserName.getText());
mark.setStudent(student);
mark.setSubject(subject);
student.setGroup(group);
subjectDAO.create(subject);
groupDAO.create(group);
studentDAO.create(student);
marksDAO.create(mark);
textFieldStudentName.clear();
TextFieldStudentUserName.clear();
subjectField.clear();
}
});
Student Class
@Entity
public class Student implements Serializable {
private static final long serialVersionUID = 4L;
@Id
@GenericGenerator(name = "generator", strategy = "increment")
@GeneratedValue(generator = "generator")
@Column(unique = true)
private int student_id;
@Column(length = 15, nullable = false,name="imie")
private String name;
@Column(length = 15, nullable = false,name="nazwisko")
private String UserName;
@ManyToOne(cascade = CascadeType.MERGE)
@JoinColumn(name = "group_id")
private Group group;
@OneToMany(targetEntity = Marks.class, mappedBy = "student", cascade = CascadeType.REMOVE)
private Set<Marks> marks;
public Student(int student_id, String name, String UserName, Group group, Set<Marks> marks) {
this.student_id = student_id;
this.name = name;
this.UserName = UserName;
this.group = group;
this.marks = marks;
}
public Student(){};
public int getStudent_id() {
return student_id;
}
public void setStudent_id(int student_id) {
this.student_id = student_id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getUserName() {
return UserName;
}
public void setUserName(String UserName) {
this.UserName = UserName;
}
public Group getGroup() {
return group;
}
public void setGroup(Group group) {
this.group = group;
}
public Set<Marks> getMarks() {
return marks;
}
public void setMarks(Set<Marks> marks) {
this.marks = marks;
}
public int setMark(int selectedMark) {
return selectedMark;
}
}
Marks Class
@Entity
@Table(name = "Oceny")
public class Marks implements Serializable {
private static final long serialVersionUID = 2L;
@Id
@GenericGenerator(name = "generator", strategy = "increment")
@GeneratedValue(generator = "generator")
@Column(unique = true)
private long ocena_id;
@Column(name = "ocena")
private int mark;
@ManyToOne(cascade = CascadeType.ALL)
@GeneratedValue
@JoinColumn(name = "subject_id")
private Subject subject;
@ManyToOne(cascade = CascadeType.ALL)
@GeneratedValue
@JoinColumn(name = "student_id")
private Student student;
public Marks(long ocena_id, int mark, Subject subject, Student student) {
this.ocena_id = ocena_id;
this.mark = mark;
this.subject = subject;
this.student = student;
}
public Marks(){};
public long getOcena_id() {
return ocena_id;
}
public void setOcena_id(long ocena_id) {
this.ocena_id = ocena_id;
}
public int getMark() {
return mark;
}
public void setMark(int mark) {
this.mark = mark;
}
public Subject getSubject() {
return subject;
}
public void setSubject(Subject subject) {
this.subject = subject;
}
public Student getStudent() {
return student;
}
public void setStudent(Student student) {
this.student = student;
}
I except to see XYZ with multiple marks and no duplications for subject, lesson group and student.
how I want to see in database
I made this manually in simple class,but I need to do this in javafx
public class ProjektPORun {
public static void main(String args) {
Student student1=new Student();
student1.setName("Adam");
student1.setUserName("Malysz");
Student student2=new Student();
student2.setName("Robert");
student2.setUserName("Kubica");
Group grupa=new Group();
grupa.setGroup_name("LAB1");
Subject subject=new Subject();
subject.setSubject_name("History");
Marks mark=new Marks();
mark.setMark(1);
Marks mark1=new Marks();
mark1.setMark(2);
Marks mark2=new Marks();
mark2.setMark(3);
student1.setGroup(grupa);
mark.setStudent(student1);
mark1.setStudent(student1);
mark.setSubject(subject);
student2.setGroup(grupa);
mark1.setStudent(student2);
mark2.setStudent(student2);
mark1.setSubject(subject);
mark2.setSubject(subject);
Configuration config = new Configuration().configure("META-INF\hibernate.cfg.xml").addAnnotatedClass(Student.class).addAnnotatedClass(Group.class).addAnnotatedClass(Marks.class).addAnnotatedClass(Subject.class);
ServiceRegistry serviceRegistry=new StandardServiceRegistryBuilder().applySettings(config.getProperties()).build();
SessionFactory factory = config.buildSessionFactory(serviceRegistry);
Session session = factory.openSession();
Transaction transaction = session.beginTransaction();
session.save(student2);
session.save(subject);
session.save(mark);
session.save(mark1);
session.save(mark2);
session.save(grupa);
session.save(student1);
transaction.commit();
session.close();
factory.close();
StandardServiceRegistryBuilder.destroy(serviceRegistry);
}
}
java database hibernate javafx
java database hibernate javafx
edited Jan 5 at 11:11
RevoWdZ
asked Jan 4 at 16:03
RevoWdZRevoWdZ
33
33
1
Please provide a Minimal, Complete, and Verifiable example that demonstrates the problem. And unrelated to your problem: please learn java naming conventions and stick to them
– kleopatra
Jan 4 at 16:19
"I want to set the same student another mark for the same subject " so you want to edit a student, rather than adding one.
– c0der
Jan 5 at 5:48
add a comment |
1
Please provide a Minimal, Complete, and Verifiable example that demonstrates the problem. And unrelated to your problem: please learn java naming conventions and stick to them
– kleopatra
Jan 4 at 16:19
"I want to set the same student another mark for the same subject " so you want to edit a student, rather than adding one.
– c0der
Jan 5 at 5:48
1
1
Please provide a Minimal, Complete, and Verifiable example that demonstrates the problem. And unrelated to your problem: please learn java naming conventions and stick to them
– kleopatra
Jan 4 at 16:19
Please provide a Minimal, Complete, and Verifiable example that demonstrates the problem. And unrelated to your problem: please learn java naming conventions and stick to them
– kleopatra
Jan 4 at 16:19
"I want to set the same student another mark for the same subject " so you want to edit a student, rather than adding one.
– c0der
Jan 5 at 5:48
"I want to set the same student another mark for the same subject " so you want to edit a student, rather than adding one.
– c0der
Jan 5 at 5:48
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54042383%2fhow-to-add-student-with-multiple-marks-into-database-using-hibernate-and-javafx%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54042383%2fhow-to-add-student-with-multiple-marks-into-database-using-hibernate-and-javafx%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Please provide a Minimal, Complete, and Verifiable example that demonstrates the problem. And unrelated to your problem: please learn java naming conventions and stick to them
– kleopatra
Jan 4 at 16:19
"I want to set the same student another mark for the same subject " so you want to edit a student, rather than adding one.
– c0der
Jan 5 at 5:48