Sunday 15 May 2011

java - Abstract Dao not updating or saving with Hibernate -


I want to be in hibernation and where I am trying to save and through the institution and for the abstract Dao class I do not want to save or update, though my removal functionality seems to work in a defective way, so I was wondering if someone could tell me where I got the wrong.

I had debug to see that this unit is actually completely full of variables when it goes to update or save. / P>

Thanks in advance for any ideas.

In the category where I am pulling all the data here:

  try {accountDao.add (newAccount); Return success; } Hold (exception e) {this.addActionError ("An unknown error has occurred please try to refresh the page"); Return INPUT; }   

which goes into the Hibernate Utility class, the entity is added to the data parameter, which is called the function to be added, but it seems that hibernation will not secure it:

  Public abstract category AbstractDao & lt; Unit & gt; HibernateDaoSupport {Adds {Zero Zero (unit unit) {getHibernateTemplate ()) Save (unit); } Public Zero removal (unit unit) {getHibernateTemplate (). Remove (unit); } Public Abstract List & lt; Unit & gt; find all(); Public abstract list & lt; Unit & gt; FindById (Long ID); Public Zune update (unit unit) {getHibernateTemplate (). Update (unit); }}   

Bean Definition

  & lt; Bean id = "account go" category = "com.dao.AccountDao" & gt; & Lt; Property Name = "sessionFactory" ref = "SessionFire" / & gt; & Lt; / Bean & gt; & Lt; Bean id = "utilityo" class = "com.dao.UtilityDao" & gt; & Lt; Property Name = "sessionFactory" ref = "SessionFire" / & gt; & Lt; / Bean & gt; & Lt; Bean id = "account_usage_Dao" class = "com.dao.Account_UsageDao" & gt; & Lt; Property Name = "sessionFactory" ref = "SessionFire" / & gt; & Lt; / Bean & gt; & Lt; Bean id = "addCustomerInfo" class = "com.action.customer.AddAction" scope = "prototype" & gt; & Lt; Property name = "account go" riff = "account" /> & lt; Property name = "utility dio" riff = "utility" /> & lt; Property Name = "account_usageDao" ref = "account_usageDao" /> & Lt; / Bean & gt;   

Update 1: Bean definition

I can not tell more Without seeing the implementation it appears that you are using spring this problem is usually with me when I forget to define the transaction reference.

Take a look at this:

No comments:

Post a Comment