| 1 | package info.ahlberg.spring.service; |
| 2 | |
| 3 | import info.ahlberg.spring.dao.ContactDAO; |
| 4 | import info.ahlberg.spring.domain.Contact; |
| 5 | |
| 6 | import org.springframework.beans.factory.annotation.Autowired; |
| 7 | import org.springframework.stereotype.Service; |
| 8 | import org.springframework.transaction.annotation.Transactional; |
| 9 | |
| 10 | @Service |
| 11 | public class ContactServiceImpl implements ContactService { |
| 12 | @Autowired |
| 13 | private ContactDAO contactDAO; |
| 14 | |
| 15 | @Override |
| 16 | public Object findAll() { |
| 17 | return contactDAO.loadAll(); |
| 18 | } |
| 19 | |
| 20 | @Override |
| 21 | @Transactional |
| 22 | public void save(Contact contact) { |
| 23 | contactDAO.persist(contact); |
| 24 | } |
| 25 | |
| 26 | } |
| 27 | |