W
WorldCreater
Unregistered / Unconfirmed
GUEST, unregistred user!
hibernate存储没反应:没有提示错误但是没有保存对象到数据库
不知道发生了什么事了
见不到 insert 语句
messages:
[WARN ] [2005-03-11 10:57:06,055] net.sf.ehcache.config.Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/D:/WORK/fjky-fzgs/project/web/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
xxxxxxxxxxxxxx
Hibernate: select pigeonhole0_.XTYPE_SYMBOL as x0_0_ from PIGEONHOLE_RULE pigeonhole0_ where ((pigeonhole0_.XTYPE_SYMBOL=? ))
Hibernate: select pigeonhole0_.XTYPE_SYMBOL as XTYPE_SY1_2_, pigeonhole0_.SIZE as SIZE2_, pigeonhole0_.PIGEONHOLE_TYPE_SYMBOL as PIGEONHO3_2_, xtype1_.SYMBOL as SYMBOL0_, xtype1_.TITLE as TITLE0_, xtype1_.NOTE as NOTE0_, pigeonhole2_.SYMBOL as SYMBOL1_, pigeonhole2_.TITLE as TITLE1_ from PIGEONHOLE_RULE pigeonhole0_ left outer join XTYPE xtype1_ on pigeonhole0_.XTYPE_SYMBOL=xtype1_.SYMBOL left outer join PIGEONHOLE_TYPE pigeonhole2_ on pigeonhole0_.PIGEONHOLE_TYPE_SYMBOL=pigeonhole2_.SYMBOL where pigeonhole0_.XTYPE_SYMBOL=?
Hibernate: select pigeonhole0_.XTYPE_SYMBOL as XTYPE_SY1_2_, pigeonhole0_.SIZE as SIZE2_, pigeonhole0_.PIGEONHOLE_TYPE_SYMBOL as PIGEONHO3_2_, xtype1_.SYMBOL as SYMBOL0_, xtype1_.TITLE as TITLE0_, xtype1_.NOTE as NOTE0_, pigeonhole2_.SYMBOL as SYMBOL1_, pigeonhole2_.TITLE as TITLE1_ from PIGEONHOLE_RULE pigeonhole0_ left outer join XTYPE xtype1_ on pigeonhole0_.XTYPE_SYMBOL=xtype1_.SYMBOL left outer join PIGEONHOLE_TYPE pigeonhole2_ on pigeonhole0_.PIGEONHOLE_TYPE_SYMBOL=pigeonhole2_.SYMBOL where pigeonhole0_.PIGEONHOLE_TYPE_SYMBOL=?
1
=========================================
code:
public void testSaveOrUpdate() {
PigeonholeRule pigeonholeRule = new PigeonholeRule();
pigeonholeRule.setXtypeSymbol("IMAGE"
pigeonholeRule.setSize(new Integer(2));
PigeonholeType pigeonholeType = new PigeonholeType();
pigeonholeType.setSymbol("none"
pigeonholeRule.setPigeonholeType(pigeonholeType);
pigeonholeRuleDao.saveOrUpdate(pigeonholeRule);
pigeonholeRuleDao.update(pigeonholeRule);
// assertEquals(pigeonholeRule,pigeonholeRuleDao.loadByPrimaryKey("IMAGE");
try {
Session session = sessionFactory.openSession();
session.saveOrUpdate(pigeonholeRule);
System.out.println("xxxxxxxxxxxxxx"
} catch(Exception e) {
e.printStackTrace();
}
PigeonholeRule obj = pigeonholeRuleDao.loadByPrimaryKey("IMAGE"
System.out.println(obj.getSize());
}
===================================
mapped classes:
public class PigeonholeRule implements Serializable {
private String xtypeSymbol;
private Integer size;
private Xtype xtype;
private PigeonholeType pigeonholeType;
}
public class PigeonholeType implements Serializable {
private String symbol;
private String title;
private PigeonholeRule pigeonholeRule;
}
public class Xtype implements Serializable {
private String symbol;
private String title;
private String note;
private PigeonholeRule pigeonholeRule;
private Set xtypeDefaultActions;
private Set xources;
private Set xtypeActions;
}
不知道发生了什么事了
见不到 insert 语句
messages:
[WARN ] [2005-03-11 10:57:06,055] net.sf.ehcache.config.Configurator - No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/D:/WORK/fjky-fzgs/project/web/WEB-INF/lib/ehcache-1.1.jar!/ehcache-failsafe.xml
xxxxxxxxxxxxxx
Hibernate: select pigeonhole0_.XTYPE_SYMBOL as x0_0_ from PIGEONHOLE_RULE pigeonhole0_ where ((pigeonhole0_.XTYPE_SYMBOL=? ))
Hibernate: select pigeonhole0_.XTYPE_SYMBOL as XTYPE_SY1_2_, pigeonhole0_.SIZE as SIZE2_, pigeonhole0_.PIGEONHOLE_TYPE_SYMBOL as PIGEONHO3_2_, xtype1_.SYMBOL as SYMBOL0_, xtype1_.TITLE as TITLE0_, xtype1_.NOTE as NOTE0_, pigeonhole2_.SYMBOL as SYMBOL1_, pigeonhole2_.TITLE as TITLE1_ from PIGEONHOLE_RULE pigeonhole0_ left outer join XTYPE xtype1_ on pigeonhole0_.XTYPE_SYMBOL=xtype1_.SYMBOL left outer join PIGEONHOLE_TYPE pigeonhole2_ on pigeonhole0_.PIGEONHOLE_TYPE_SYMBOL=pigeonhole2_.SYMBOL where pigeonhole0_.XTYPE_SYMBOL=?
Hibernate: select pigeonhole0_.XTYPE_SYMBOL as XTYPE_SY1_2_, pigeonhole0_.SIZE as SIZE2_, pigeonhole0_.PIGEONHOLE_TYPE_SYMBOL as PIGEONHO3_2_, xtype1_.SYMBOL as SYMBOL0_, xtype1_.TITLE as TITLE0_, xtype1_.NOTE as NOTE0_, pigeonhole2_.SYMBOL as SYMBOL1_, pigeonhole2_.TITLE as TITLE1_ from PIGEONHOLE_RULE pigeonhole0_ left outer join XTYPE xtype1_ on pigeonhole0_.XTYPE_SYMBOL=xtype1_.SYMBOL left outer join PIGEONHOLE_TYPE pigeonhole2_ on pigeonhole0_.PIGEONHOLE_TYPE_SYMBOL=pigeonhole2_.SYMBOL where pigeonhole0_.PIGEONHOLE_TYPE_SYMBOL=?
1
=========================================
code:
public void testSaveOrUpdate() {
PigeonholeRule pigeonholeRule = new PigeonholeRule();
pigeonholeRule.setXtypeSymbol("IMAGE"
pigeonholeRule.setSize(new Integer(2));
PigeonholeType pigeonholeType = new PigeonholeType();
pigeonholeType.setSymbol("none"
pigeonholeRule.setPigeonholeType(pigeonholeType);
pigeonholeRuleDao.saveOrUpdate(pigeonholeRule);
pigeonholeRuleDao.update(pigeonholeRule);
// assertEquals(pigeonholeRule,pigeonholeRuleDao.loadByPrimaryKey("IMAGE");
try {
Session session = sessionFactory.openSession();
session.saveOrUpdate(pigeonholeRule);
System.out.println("xxxxxxxxxxxxxx"
} catch(Exception e) {
e.printStackTrace();
}
PigeonholeRule obj = pigeonholeRuleDao.loadByPrimaryKey("IMAGE"
System.out.println(obj.getSize());
}
===================================
mapped classes:
public class PigeonholeRule implements Serializable {
private String xtypeSymbol;
private Integer size;
private Xtype xtype;
private PigeonholeType pigeonholeType;
}
public class PigeonholeType implements Serializable {
private String symbol;
private String title;
private PigeonholeRule pigeonholeRule;
}
public class Xtype implements Serializable {
private String symbol;
private String title;
private String note;
private PigeonholeRule pigeonholeRule;
private Set xtypeDefaultActions;
private Set xources;
private Set xtypeActions;
}