Spring MVC Example

Spring MVC Example Git Source Tree

Root/src/main/java/info/ahlberg/spring/ContactServiceImpl.java

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

Archive Download this file

Branches