Salome HOME
-Fix recusion bug
[modules/gde.git] / projects / GDE_App / GDE-ejb / src / java / com / edf / gde / ejb / MetadataEJB.java
1 package com.edf.gde.ejb;
2
3 import com.edf.gde.dao.MetadataDao;
4 import com.edf.gde.transferables.AttributeGroupTO;
5 import com.edf.gde.transferables.AttributeTO;
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 MetadataEJB {
18
19     @PersistenceContext(unitName = "GDE-ejbPU")
20     private EntityManager em;
21
22     /* Attributes */
23     public AttributeTO createAttribute(AttributeTO ato) {
24         MetadataDao dao = new MetadataDao(em);
25         return dao.createAttribute(ato);
26     }
27
28     public void deleteAttribute(AttributeTO ato) {
29         MetadataDao dao = new MetadataDao(em);
30         dao.deleteAttribute(ato);
31     }
32
33     public AttributeTO updateAttribute(AttributeTO ato) {
34         MetadataDao dao = new MetadataDao(em);
35         return dao.updateAttribute(ato);
36     }
37
38     public AttributeTO findAttribute(AttributeTO ato) {
39         MetadataDao dao = new MetadataDao(em);
40         return dao.findAttribute(ato);
41     }
42
43     public AttributeTO findById(long id) {
44         MetadataDao dao = new MetadataDao(em);
45         return dao.findById(id);
46     }
47
48     public AttributeTO findByName(String name) {
49         MetadataDao dao = new MetadataDao(em);
50         return dao.findByName(name);
51     }
52
53     public AttributeTO findByType(String type) {
54         MetadataDao dao = new MetadataDao(em);
55         return dao.findByType(type);
56     }
57
58     public AttributeTO findByValue(String value) {
59         MetadataDao dao = new MetadataDao(em);
60         return dao.findByValue(value);
61     }
62
63     /* Attributes Groups */
64     public AttributeGroupTO createAttributeGroup(AttributeGroupTO agto) {
65         MetadataDao dao = new MetadataDao(em);
66         return dao.createAttributeGroup(agto);
67     }
68
69     public void deleteAttributeGroup(AttributeGroupTO agto) {
70         MetadataDao dao = new MetadataDao(em);
71         dao.deleteAttributeGroup(agto);
72     }
73
74     public AttributeGroupTO updateAttributeGroup(AttributeGroupTO agto) {
75         MetadataDao dao = new MetadataDao(em);
76         return dao.updateAttributeGroup(agto);
77     }
78
79     public AttributeGroupTO findAttributeGroup(AttributeGroupTO agto) {
80         MetadataDao dao = new MetadataDao(em);
81         return dao.findAttributeGroup(agto);
82     }
83
84     public AttributeGroupTO findGroupById(long groupId) {
85         MetadataDao dao = new MetadataDao(em);
86         return dao.findGroupById(groupId);
87     }
88
89 }