java swing JTable中加入的复选框JCheckBox为何不能复选,一次只能选一个?急需!!
- 提问者网友:不爱我么
- 2021-02-18 16:53
- 五星知识达人网友:青灯有味
- 2021-02-18 18:02
- 1楼网友:千夜
- 2021-02-18 20:31
hibernate都设置好了吗?
假设入库调用了以下的方法:
public void persist(list<item> items);
(item是商品的类)
session session = hibernateutil.getsessionfactory().getcurrentsession(); session.begintransaction();
for(item item: items)
session.save(item); session.gettransaction().commit();
// hibernateutil的代码如下
import org.hibernate.sessionfactory; import org.hibernate.cfg.configuration; public class hibernateutil
{
private static final sessionfactory sessionfactory = buildsessionfactory(); private static sessionfactory buildsessionfactory()
{ try
{ // create the sessionfactory from hibernate.cfg.xml return new configuration().configure().buildsessionfactory(); } catch(throwable ex)
{ // make sure you log the exception, as it might be swallowed system.err.println("initial sessionfactory creation failed." + ex); throw new runtimeexception(ex); } } public static sessionfactory getsessionfactory()
{ return sessionfactory; } }
我是觉得jpa比hibernate好用点……
- 2楼网友:西岸风
- 2021-02-18 19:59
- 3楼网友:千杯敬自由
- 2021-02-18 18:43