I was trying this MyEclipse Hibernate and Spring Tutorial from MyEclipse Education Material hosted on this site.
I am trying this but not getting to save new user..I changed the Integer and also
created primary key autogeneration from table .But All my attempts do not work.
I am following the Steps exactly as per tutorial.I have tried with 7.1 and 7.5.
Please help…Is there a configuration to be done not mentioned in the tutorial.
I am just Copy pasting the tutorial code not working as it should below
nteger id = new Integer(1);
User user = new User();
user.setId(id);
user.setUsername(“jdoe”);
user.setPassword(“1234”);
user.setFirstName(“John”);
user.setLastName(“Doe”);
user.setDateCreated(Long.valueOf(System.currentTimeMillis()));
/* 2. Load the Spring bean configuration and create a bean factory */
BeanFactory beanFactory = new XmlBeanFactory(new ClassPathResource(
“applicationContext.xml”));
/* 3. Create instance of PersistenceLayer */
PersistenceLayer persistenceLayer = (PersistenceLayer) beanFactory
.getBean(“persistenceLayer”);
/* 4. Save the new user to the database */
persistenceLayer.addUser(user);
____DOES NOT SAVE THE USER NOR IT DOES GIVE ANY ERROR________
please help ,
Anup Chauhan