title: Data not getting stored in database
body: <p>I was implementing springs and hibernate annotation in netbeans. When i try to save the data in database it doesn't happen. Table is getting created when i launch the application from netbeans but fails to store data in it. </p>
  
  <pre><code>&lt;bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"&gt;
      &lt;property name="driverClassName" value="org.apache.derby.jdbc.ClientDriver"/&gt;
      &lt;property name="url" value="jdbc:derby://localhost:1527/seed"/&gt;
      &lt;property name="username" value="root"/&gt;
      &lt;property name="password" value="root"/&gt;
  &lt;/bean&gt;
  
  &lt;bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"&gt;
      &lt;property name="dataSource" ref="myDataSource" /&gt;
      &lt;property name="annotatedClasses"&gt;
          &lt;list&gt;
              &lt;value&gt;com.vaannila.domain.User&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
      &lt;property name="hibernateProperties"&gt;
          &lt;props&gt;
              &lt;prop key="hibernate.dialect"&gt;org.hibernate.dialect.DerbyDialect&lt;/prop&gt;
              &lt;prop key="hibernate.show_sql"&gt;true&lt;/prop&gt;
              &lt;prop key="hibernate.hbm2ddl.auto"&gt;update&lt;/prop&gt;
          &lt;/props&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <p>dao class:</p>
  
  <pre><code>@Repository("userDao")
  public class UserDAOImpl implements UserDAO {
  
  @Autowired
  private SessionFactory sessionFactory;
  
  /*public void setSessionFactory(SessionFactory sessionFactory) {
      this.hibernateTemplate = new HibernateTemplate(sessionFactory);
  }*/
  
  @Override
  public void saveUser(User user) {
      sessionFactory.getCurrentSession().saveOrUpdate (user);
  }
  
  @Override
  @SuppressWarnings("unchecked")
  public List&lt;User&gt; listUser() {
      return (List&lt;User&gt;) sessionFactory.getCurrentSession().
                      createCriteria ( User.class ).list(); 
  }
  
  }
  </code></pre>
  
  <p>service class:</p>
  
  <pre><code>@Service("userService")
  @Transactional(propagation=Propagation.SUPPORTS, readOnly=true)
  public class UserServiceImpl implements UserService {
  
      @Autowired
  private UserDAO userDAO;
  
      @Override
  public void saveUser(User user) {
      userDAO.saveUser(user);
  }
  
  @Override
  @SuppressWarnings("unchecked")
  public List&lt;User&gt; listUser() {
      return userDAO.listUser();
  }
  
  }
  </code></pre>
  
  <p>Please help me out.</p>
  
  <p>Thanks in advance</p>