?? test5.java
字號:
package com.elan.forum.test;
import java.util.Iterator;
import java.util.List;
import org.hibernate.SQLQuery;
import org.hibernate.Session;
import org.hibernate.Transaction;
import com.elan.db.ElHbnDB;
import com.elan.forum.elf.El;
import com.elan.forum.model.ForumTopic;
import com.elan.forum.model.view.Forumnewtopic;
import com.elan.forum.model.view.ForumnewtopicId;
public class Test5 {
public static void main(String[] args) throws Exception {
Session session = ElHbnDB.getSession();
Transaction tx = session.beginTransaction();
try {
ForumTopic ft = (ForumTopic)session.createQuery("from ForumTopic where id = 2").list().get(0);
tx.commit();
System.out.println(ft.getPiece().getName());
} catch (Exception re) {
tx.rollback();
} finally {
ElHbnDB.closeSession();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -