Created
April 14, 2017 16:51
-
-
Save nhojpatrick/e0813f2cd4e3a77992290b94274be5c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Student { | |
... | |
} | |
public class FrontEndCode { | |
... | |
public void updateStudentWithNewName(final Id id, final String firstName, final String lastName) { | |
final Student student = bec.getStudent(id); | |
student.setFirstName(firstName); | |
student.setLastName(lastName); | |
bec.saveStudent(student); | |
} | |
... | |
} | |
public class BackEndCode { | |
... | |
public Student getStudent(final Id id) { | |
return em.find(Student.class, id); | |
} | |
public void saveStudent(final Student student) { | |
em.merge(student); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment