⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 companyemployeeclient.java

📁 EJB3.0请一定要上载质量高而且本站没有的源码
💻 JAVA
字号:
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();
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -