Search in sources :

Example 1 with Log

use of com.artezio.arttime.admin_tool.log.Log in project ART-TIME by Artezio.

the class HourTypeRepository method remove.

@FacesMessage(onCompleteMessageKey = "message.hourTypeIsDeleted")
@WebCached(resetCache = true)
@Log(logParams = true)
public void remove(@DetailedLogged HourType hourType) throws ActualTimeRemovalException {
    if (hourType.isActualTime()) {
        throw new ActualTimeRemovalException("Attempt to delete an actual time.");
    }
    HourType type = entityManager.find(HourType.class, hourType.getId());
    entityManager.remove(type);
    entityManager.flush();
}
Also used : ActualTimeRemovalException(com.artezio.arttime.exceptions.ActualTimeRemovalException) HourType(com.artezio.arttime.datamodel.HourType) WebCached(com.artezio.arttime.admin_tool.cache.WebCached) Log(com.artezio.arttime.admin_tool.log.Log) FacesMessage(com.artezio.arttime.web.interceptors.FacesMessage)

Example 2 with Log

use of com.artezio.arttime.admin_tool.log.Log in project ART-TIME by Artezio.

the class ProjectRepository method remove.

@Log(logParams = true)
@FacesMessage(onCompleteMessageKey = "message.projectIsDeleted")
@WebCached(resetCache = true)
public void remove(@DetailedLogged Project project) {
    Project managedProject = entityManager.find(Project.class, project.getId());
    entityManager.remove(managedProject);
    entityManager.flush();
}
Also used : Project(com.artezio.arttime.datamodel.Project) WebCached(com.artezio.arttime.admin_tool.cache.WebCached) Log(com.artezio.arttime.admin_tool.log.Log) FacesMessage(com.artezio.arttime.web.interceptors.FacesMessage)

Aggregations

WebCached (com.artezio.arttime.admin_tool.cache.WebCached)2 Log (com.artezio.arttime.admin_tool.log.Log)2 FacesMessage (com.artezio.arttime.web.interceptors.FacesMessage)2 HourType (com.artezio.arttime.datamodel.HourType)1 Project (com.artezio.arttime.datamodel.Project)1 ActualTimeRemovalException (com.artezio.arttime.exceptions.ActualTimeRemovalException)1