trouble on save or update obj. no error but can't work
obj can't save or update to database .
I can't see the insert or update sql.
what happend????????
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;
}
_________________ I am the creatxr of world.
|