?? test.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("");
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -