01: /*
02: * Wilos Is a cLever process Orchestration Software - http://www.wilos-project.org
03: * Copyright (C) 2006-2007 Paul Sabatier University, IUP ISI (Toulouse, France) <massie@irit.fr>
04: * Copyright (C) Sebastien BALARD <sbalard@wilos-project.org>
05: *
06: * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
07: * General Public License as published by the Free Software Foundation; either version 2 of the License,
08: * or (at your option) any later version.
09: *
10: * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
11: * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU General Public License for more details.
13: *
14: * You should have received a copy of the GNU General Public License along with this program; if not,
15: * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16: */
17:
18: package wilos.business.services.misc.concreteiteration;
19:
20: import java.util.HashSet;
21: import java.util.Set;
22:
23: import wilos.hibernate.misc.concreteiteration.ConcreteIterationDao;
24: import wilos.model.misc.concretebreakdownelement.ConcreteBreakdownElement;
25: import wilos.model.misc.concreteiteration.ConcreteIteration;
26:
27: public class ConcreteIterationService {
28:
29: public ConcreteIterationDao concreteIterationDao;
30:
31: /**
32: * Allows to get the concreteIteration with the id
33: *
34: * @param _concreteIterationId
35: * @return the concreteIteration
36: */
37: public ConcreteIteration getConcreteIteration(
38: String _concreteIterationId) {
39: return this .getConcreteIterationDao().getConcreteIteration(
40: _concreteIterationId);
41: }
42:
43: /**
44: * Allows to save the concreteIteration
45: *
46: * @param _concreteIteration
47: */
48: public void saveConcreteIteration(
49: ConcreteIteration _concreteIteration) {
50: this .concreteIterationDao
51: .saveOrUpdateConcreteIteration(_concreteIteration);
52: }
53:
54: /**
55: * Allows to get the set of all concreteBreakdownElement
56: *
57: * @param _concreteIteration
58: * @return the set of all concreteBreakdownElement
59: */
60: public Set<ConcreteBreakdownElement> getAllConcreteBreakdownElements(
61: ConcreteIteration _concreteIteration) {
62: Set<ConcreteBreakdownElement> tmp = new HashSet<ConcreteBreakdownElement>();
63:
64: this .getConcreteIterationDao().getSessionFactory()
65: .getCurrentSession().saveOrUpdate(_concreteIteration);
66: for (ConcreteBreakdownElement element : _concreteIteration
67: .getConcreteBreakdownElements()) {
68: tmp.add(element);
69: }
70: return tmp;
71: }
72:
73: /**
74: * Allows to get the concreteIterationDao
75: *
76: * @return the concreteIterationDao
77: */
78: public ConcreteIterationDao getConcreteIterationDao() {
79: return concreteIterationDao;
80: }
81:
82: /**
83: * Allows to set the concreteIterationDao
84: *
85: * @param concreteIterationDao
86: *
87: */
88: public void setConcreteIterationDao(
89: ConcreteIterationDao concreteIterationDao) {
90: this.concreteIterationDao = concreteIterationDao;
91: }
92: }
|