EntityWithServiceImplServiceImpl.java
package io.github.jhipster.sample.service.impl;
/*-
* #%L
* Jhipster Sample Application
* %%
* Copyright (C) 2017 Osgiliath
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import io.github.jhipster.sample.service.EntityWithServiceImplService;
import io.github.jhipster.sample.domain.EntityWithServiceImpl;
import io.github.jhipster.sample.repository.EntityWithServiceImplRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* Service Implementation for managing EntityWithServiceImpl.
*/
@Service
@Transactional
public class EntityWithServiceImplServiceImpl implements EntityWithServiceImplService{
private final Logger log = LoggerFactory.getLogger(EntityWithServiceImplServiceImpl.class);
private final EntityWithServiceImplRepository entityWithServiceImplRepository;
public EntityWithServiceImplServiceImpl(EntityWithServiceImplRepository entityWithServiceImplRepository) {
this.entityWithServiceImplRepository = entityWithServiceImplRepository;
}
/**
* Save a entityWithServiceImpl.
*
* @param entityWithServiceImpl the entity to save
* @return the persisted entity
*/
@Override
public EntityWithServiceImpl save(EntityWithServiceImpl entityWithServiceImpl) {
log.debug("Request to save EntityWithServiceImpl : {}", entityWithServiceImpl);
return entityWithServiceImplRepository.save(entityWithServiceImpl);
}
/**
* Get all the entityWithServiceImpls.
*
* @return the list of entities
*/
@Override
@Transactional(readOnly = true)
public List<EntityWithServiceImpl> findAll() {
log.debug("Request to get all EntityWithServiceImpls");
return entityWithServiceImplRepository.findAll();
}
/**
* Get one entityWithServiceImpl by id.
*
* @param id the id of the entity
* @return the entity
*/
@Override
@Transactional(readOnly = true)
public EntityWithServiceImpl findOne(Long id) {
log.debug("Request to get EntityWithServiceImpl : {}", id);
return entityWithServiceImplRepository.findOne(id);
}
/**
* Delete the entityWithServiceImpl by id.
*
* @param id the id of the entity
*/
@Override
public void delete(Long id) {
log.debug("Request to delete EntityWithServiceImpl : {}", id);
entityWithServiceImplRepository.delete(id);
}
}