Package com.captechconsulting.core.service

Source Code of com.captechconsulting.core.service.LocationService

package com.captechconsulting.core.service;

import com.captechconsulting.core.dao.LocationDao;
import com.captechconsulting.core.domain.Location;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class LocationService {

    @Autowired
    private LocationDao locationDao;
                         
    public Location get(final long id) {
        return locationDao.findOne(id);
    }

    public List<Location> list(int page, int size) {
        return locationDao.findAll(new PageRequest(page, size)).getContent();
    }

    public Location store(Location location) {
        return locationDao.save(location);
    }

    public void delete(Location ticket) {
        if (ticket.getId() != null) {
            locationDao.delete(ticket);
        } else {
            locationDao.delete(ticket);
        }
    }

}
TOP

Related Classes of com.captechconsulting.core.service.LocationService

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.