1 package com.edf.gde.ejb;
3 import com.edf.gde.dao.FileDao;
4 import com.edf.gde.transferables.FileTO;
6 import javax.ejb.Stateless;
7 import javax.ejb.LocalBean;
8 import javax.persistence.EntityManager;
9 import javax.persistence.PersistenceContext;
17 public class FileEJB {
19 @PersistenceContext(unitName = "GDE-ejbPU")
20 private EntityManager em;
22 public FileTO createFile(FileTO fto) {
23 FileDao dao = new FileDao(em);
24 return dao.createFile(fto);
27 public void deleteFile(FileTO fto) {
28 FileDao dao = new FileDao(em);
32 public FileTO updateFile(FileTO fto) {
33 FileDao dao = new FileDao(em);
34 return dao.updateFile(fto);
37 public FileTO findFile(FileTO fto) {
38 FileDao dao = new FileDao(em);
39 return dao.findFile(fto);
42 public FileTO findById(long id) {
43 FileDao dao = new FileDao(em);
44 return dao.findById(id);
47 public FileTO findByName(String name) {
48 FileDao dao = new FileDao(em);
49 return dao.findByName(name);
52 public FileTO findByCreationDate(Date creationDate) {
53 FileDao dao = new FileDao(em);
54 return dao.findByCreationDate(creationDate);
57 public FileTO findByUpdateDate(Date updateDate) {
58 FileDao dao = new FileDao(em);
59 return dao.findByUpdateDate(updateDate);
62 public FileTO findByDeletionDate(Date deletionDate) {
63 FileDao dao = new FileDao(em);
64 return dao.findByDeletionDate(deletionDate);