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

📄 test.java

📁 机票预定系统 是面向客户和管理员的平台提供 注册,登陆 查询预定 退票等服务
💻 JAVA
字号:
package test;

import java.util.Iterator;
import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.FileSystemXmlApplicationContext;
import org.springframework.orm.hibernate3.HibernateTemplate;

import bit.jeffy.orm.Flight;
import bit.jeffy.orm.Order;

public class Test {
	public static void main(String argv[]){
		String hql="from Order order";
		ApplicationContext context = new FileSystemXmlApplicationContext("WEB-INF/beans.xml");
		HibernateTemplate template = (HibernateTemplate)context.getBean("hibernateTemplate");
		Order order = null;
		
		List list = template.find(hql);
		Iterator it = list.iterator();
		
		while(it.hasNext()){
			order = (Order)it.next();
			Flight f = (Flight)order.getOrderitem().getFlight();
			System.out.print(order.getId()+",");
			System.out.print(f.getPrice());
			System.out.println("");
		}
	}
}

⌨️ 快捷键说明

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