summaryrefslogtreecommitdiffstats
path: root/Master/Reference Architectures and Patterns/EJB 3.0 Code/Micah Examples/src/examples/entity/uni/many_to_many/client
diff options
context:
space:
mode:
authorSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
committerSven Eisenhauer <sven@sven-eisenhauer.net>2023-11-10 15:11:48 +0100
commit33613a85afc4b1481367fbe92a17ee59c240250b (patch)
tree670b842326116b376b505ec2263878912fca97e2 /Master/Reference Architectures and Patterns/EJB 3.0 Code/Micah Examples/src/examples/entity/uni/many_to_many/client
downloadStudium-master.tar.gz
Studium-master.tar.bz2
add new repoHEADmaster
Diffstat (limited to 'Master/Reference Architectures and Patterns/EJB 3.0 Code/Micah Examples/src/examples/entity/uni/many_to_many/client')
-rw-r--r--Master/Reference Architectures and Patterns/EJB 3.0 Code/Micah Examples/src/examples/entity/uni/many_to_many/client/StudentCourseClient.java30
1 files changed, 30 insertions, 0 deletions
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Micah Examples/src/examples/entity/uni/many_to_many/client/StudentCourseClient.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Micah Examples/src/examples/entity/uni/many_to_many/client/StudentCourseClient.java
new file mode 100644
index 0000000..d18aee2
--- /dev/null
+++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Micah Examples/src/examples/entity/uni/many_to_many/client/StudentCourseClient.java
@@ -0,0 +1,30 @@
+package examples.entity.uni.many_to_many.client;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import examples.entity.uni.many_to_many.Course;
+import examples.entity.uni.many_to_many.Student;
+import examples.entity.uni.many_to_many.interfaces.StudentCourse;
+
+
+public class StudentCourseClient {
+ public static void main(String[] args) {
+ try {
+ InitialContext ic = new InitialContext();
+ StudentCourse sc = (StudentCourse)ic.lookup(StudentCourse.class.getName());
+
+ sc.doSomeStuff();
+
+ for (Student s : sc.getAllStudents()) {
+ System.out.println("Student: "+s.getName());
+ for (Course c : s.getCourses()) {
+ System.out.println("\tCourse: "+c.getCourseName());
+ }
+ }
+ }
+ catch (NamingException e) {
+ e.printStackTrace();
+ }
+ }
+}