Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
Articles
Articles_pt
CreateManager_pt
LeftMenu




JSPWiki v2.2.33

[RSS]


Hide Menu

CreateDAO_pt


Difference between version 26 and version 25:

At line 314 removed 2 lines.
import java.util.List;
At line 317 removed 3 lines.
public List getPeople(Person person);
At line 321 changed 3 lines.
public void savePerson(Object person);
public void savePerson(Person person);
At line 338 removed 3 lines.
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
At line 333 added 1 line.
import org.springframework.orm.ObjectRetrievalFailureException;
At line 344 removed 3 lines.
import java.util.List;
At line 349 changed 1 line.
private Log log = LogFactory.getLog(PersonDaoHibernate.class);
public Person getPerson(Long id) {
Person person = (Person) getHibernateTemplate().get(Person.class, id);
At line 351 changed 3 lines.
public List getPeople(Person person) {
return getHibernateTemplate().find("from Person");
}
if (person == null) {
throw new ObjectRetrievalFailureException(Person.class, id);
}
At line 355 changed 2 lines.
public Person getPerson(Long id) {
return (Person) getHibernateTemplate().get(Person.class, id);
return person;
At line 359 changed 1 line.
public void savePerson(Object person) {
public void savePerson(Person person) {
At line 364 changed 2 lines.
Object person = getHibernateTemplate().load(Person.class, id);
getHibernateTemplate().delete(person);
// object must be loaded before it can be deleted
getHibernateTemplate().delete(getPerson(id));
At line 370 removed 1 line.

Back to CreateDAO_pt, or to the Page History.