use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.
the class TeachingDocumentsServiceSimpleImpl method createAnexoApostila.
@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public Long createAnexoApostila(AnexoApostilaDTO anexo) {
AnexoApostilaDAO dao = factory.getAnexoApostilaDAO();
AnexoApostila model = new AnexoApostila(anexo);
Long id = null;
try {
id = dao.create(model);
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
} catch (Exception ex) {
throw new CoreException("Erro de sistema: " + ex.getMessage());
}
return id;
}
use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.
the class TeachingDocumentsServiceSimpleImpl method createSecaoApostila.
@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public Long createSecaoApostila(SecaoApostilaDTO secao) {
SecaoApostilaDAO dao = factory.getSecaoApostilaDAO();
ContentDAO contentDAO = factory.getContentDAO();
CapituloApostilaDAO capituloDAO = factory.getCapituloApostilaDAO();
ApostilaDAO apostilaDAO = factory.getApostilaDAO();
SecaoApostila model = new SecaoApostila(secao);
Long id = null;
try {
id = dao.create(model);
model = dao.find(id);
String folderName = String.valueOf(model.getId());
CapituloApostila capitulo = capituloDAO.find(model.getCapituloApostila().getId());
Apostila apostila = apostilaDAO.find(capitulo.getApostila().getId());
FolderDTO folder = new FolderDTO();
folder.setName(folderName);
String assetsFolderId = contentDAO.createFolderWithUUIDParent(folder, apostila.getAssetsFolderId());
model.setAssetsFolderId(assetsFolderId);
dao.update(model);
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
} catch (Exception ex) {
throw new CoreException("Erro de sistema: " + ex.getMessage());
}
return id;
}
use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.
the class TeachingDocumentsServiceSimpleImpl method createRecomendacaoMetodologica.
@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public Long createRecomendacaoMetodologica(RecomendacaoMetodologicaDTO recomendacao) {
RecomendacaoMetodologicaDAO dao = factory.getRecomendacaoMetodologicaDAO();
RecomendacaoMetodologica model = new RecomendacaoMetodologica(recomendacao);
Long id = null;
try {
id = dao.create(model);
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
} catch (Exception ex) {
throw new CoreException("Erro de sistema: " + ex.getMessage());
}
return id;
}
use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.
the class TeachingDocumentsServiceSimpleImpl method createConceituacao.
@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public Long createConceituacao(ConceituacaoDTO conceituacao) {
ConceituacaoDAO dao = factory.getConceituacaoDAO();
Conceituacao model = new Conceituacao(conceituacao);
Long id = null;
try {
id = dao.create(model);
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
} catch (Exception ex) {
throw new CoreException("Erro de sistema: " + ex.getMessage());
}
return id;
}
use of com.tomasio.projects.trainning.exception.DAOException in project trainning by fernandotomasio.
the class TeachingDocumentsServiceSimpleImpl method updateSecaoApostila.
@Override
@Transactional
@SuppressWarnings({ "BroadCatchBlock", "TooBroadCatch" })
public void updateSecaoApostila(SecaoApostilaDTO secao) {
SecaoApostilaDAO dao = factory.getSecaoApostilaDAO();
SecaoApostila model = new SecaoApostila(secao);
try {
dao.update(model);
} catch (DAOException ex) {
throw new CoreException("Erro de de acesso ao banco de dados: " + ex.getMessage());
} catch (Exception ex) {
throw new CoreException("Erro de sistema: " + ex.getMessage());
}
}
Aggregations