diff options
| author | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
|---|---|---|
| committer | Sven Eisenhauer <sven@sven-eisenhauer.net> | 2023-11-10 15:11:48 +0100 |
| commit | 33613a85afc4b1481367fbe92a17ee59c240250b (patch) | |
| tree | 670b842326116b376b505ec2263878912fca97e2 /Master/Reference Architectures and Patterns/EJB 3.0 Code/Micah Examples/src/examples/entity/uni/one_to_many/client | |
| download | Studium-master.tar.gz Studium-master.tar.bz2 | |
Diffstat (limited to 'Master/Reference Architectures and Patterns/EJB 3.0 Code/Micah Examples/src/examples/entity/uni/one_to_many/client')
| -rw-r--r-- | Master/Reference Architectures and Patterns/EJB 3.0 Code/Micah Examples/src/examples/entity/uni/one_to_many/client/CompanyEmployeeClient.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Master/Reference Architectures and Patterns/EJB 3.0 Code/Micah Examples/src/examples/entity/uni/one_to_many/client/CompanyEmployeeClient.java b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Micah Examples/src/examples/entity/uni/one_to_many/client/CompanyEmployeeClient.java new file mode 100644 index 0000000..6077c1a --- /dev/null +++ b/Master/Reference Architectures and Patterns/EJB 3.0 Code/Micah Examples/src/examples/entity/uni/one_to_many/client/CompanyEmployeeClient.java @@ -0,0 +1,35 @@ +package examples.entity.uni.one_to_many.client;
+
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import examples.entity.uni.one_to_many.Company;
+import examples.entity.uni.one_to_many.Employee;
+import examples.entity.uni.one_to_many.interfaces.CompanyEmployeeOM;
+
+
+public class CompanyEmployeeClient {
+ public static void main(String[] args) {
+ try {
+ InitialContext ic = new InitialContext();
+ CompanyEmployeeOM ceom = (CompanyEmployeeOM)ic.lookup(CompanyEmployeeOM.class.getName());
+
+ ceom.deleteCompanies();
+
+ ceom.doSomeStuff();
+
+ System.out.println("All Companies:");
+ for (Object o : ceom.getCompanies()) {
+ Company c = (Company)o;
+ System.out.println("Here are the employees for company: "+c.getName());
+ for (Employee e : c.getEmployees()) {
+ System.out.println("\tName: "+e.getName()+", Sex: "+e.getSex());
+ }
+ System.out.println();
+ }
+ }
+ catch (NamingException e) {
+ e.printStackTrace();
+ }
+ }
+}
\ No newline at end of file |
