]> SALOME platform Git repositories - modules/gde.git/blob - projects/GDE_App/GDE-ejb/src/java/com/edf/gde/ejb/FileEJB.java
Salome HOME
Merge branch 'permissions' of /media/mordicus/git/salome-gde into permissions
[modules/gde.git] / projects / GDE_App / GDE-ejb / src / java / com / edf / gde / ejb / FileEJB.java
1 package com.edf.gde.ejb;
2
3 import com.edf.gde.dao.FileDao;
4 import com.edf.gde.transferables.FileTO;
5 import java.util.Date;
6 import javax.ejb.Stateless;
7 import javax.ejb.LocalBean;
8 import javax.persistence.EntityManager;
9 import javax.persistence.PersistenceContext;
10
11 /**
12  *
13  * @author F62173
14  */
15 @Stateless
16 @LocalBean
17 public class FileEJB {
18
19     @PersistenceContext(unitName = "GDE-ejbPU")
20     private EntityManager em;
21
22     public FileTO createFile(FileTO fto) {
23         FileDao dao = new FileDao(em);
24         return dao.createFile(fto);
25     }
26
27     public void deleteFile(FileTO fto) {
28         FileDao dao = new FileDao(em);
29         dao.deleteFile(fto);
30     }
31
32     public FileTO updateFile(FileTO fto) {
33         FileDao dao = new FileDao(em);
34         return dao.updateFile(fto);
35     }
36
37     public FileTO findFile(FileTO fto) {
38         FileDao dao = new FileDao(em);
39         return dao.findFile(fto);
40     }
41
42     public FileTO findById(long id) {
43         FileDao dao = new FileDao(em);
44         return dao.findById(id);
45     }
46
47     public FileTO findByName(String name) {
48         FileDao dao = new FileDao(em);
49         return dao.findByName(name);
50     }
51
52     public FileTO findByCreationDate(Date creationDate) {
53         FileDao dao = new FileDao(em);
54         return dao.findByCreationDate(creationDate);
55     }
56
57     public FileTO findByUpdateDate(Date updateDate) {
58         FileDao dao = new FileDao(em);
59         return dao.findByUpdateDate(updateDate);
60     }
61
62     public FileTO findByDeletionDate(Date deletionDate) {
63         FileDao dao = new FileDao(em);
64         return dao.findByDeletionDate(deletionDate);
65     }
66
67 }