hum, but in Person class, his Id is an Integer type Juan
On Fri, Aug 21, 2009 at 7:12 PM, Tommy Pham<tommy...@yahoo.com> wrote: > Hi, > > I think the tutorial > http://struts.apache.org/2.1.6/docs/struts-2-spring-2-jpa-ajax.html is > misleading(?). In the PersonServiceImpl class, the method: > > public void save(Person person) { > if (person.getId() == null) { > em.persist(person); > } else { > em.merge(person); > } > } > > has an error of 'The operator == is undefined for the argument type(s) int'. > Because > the default value would be 0 per > http://java.sun.com/docs/books/tutorial/java/nutsandbolts/datatypes.html. I > think it should be: > if (person.getId() == 0) > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@struts.apache.org > For additional commands, e-mail: user-h...@struts.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org