If i write a loop in DAO layer


#1

I trying to delete list of data from DB .

CODE :–>
i am write this code in DAO layer.
Is this any problem to write in DAO layer . Or batter to write in service layer .
for (String documentId : documentsIds) {
em = (new ServiceThreadLocal()).get().getEntityManager();
//documentEntity = em.find(DocumentEntity.class, documentId );
// filePath = documentEntity.getFilePath();
Query query = em.createNamedQuery(documentEntity_deleteDoc);
query.setParameter(“documentId”, documentId);
query.executeUpdate();

	}