
Find Great God look
------ Solution -------------------------------- ------------
of the mother. . . . . . . . .
------ Solution ---------------------------------------- ----
whether Hibernate dialect configuration not
------ Solution -------------------------- ------------------
first, in the spring configuration file applicationContext configured :
<-! declarative transaction management - >
<-! declarative transaction management end - >
Then dao transaction management configuration you want to use :
<-! declarative transaction management configuration DAO ->
After
UserDao will be used as long as the getHibernateTemplate () save (user);. methods can be named saveXXX
can try this way , just to check in online , you want to help, and have time to look Keguan Chi Chuan broadcast online . NET video , which explains the very thorough
---- - For reference only ---------------------------------------

public void save (User u)
{
Session s = sessionFactory.openSession ();
s.beginTransaction ();
s.save (u);
s.getTransaction () commit ().;
System.out.println ("user save!");
} This is my save method is to deposit does not go ah, null values can not I? Used SQL2005
------ For reference only ----------------------------------- ----
issue is resolved, do not pay attention to some details of his own , thank you upstairs pro
没有评论:
发表评论