Source Code Cross Referenced for ConcreteRoleDescriptorDao.java in  » Workflow-Engines » wilos » wilos » hibernate » misc » concreterole » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Workflow Engines » wilos » wilos.hibernate.misc.concreterole 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Wilos Is a cLever process Orchestration Software - http://www.wilos-project.org
003:         * Copyright (C) 2006-2007 Paul Sabatier University, IUP ISI (Toulouse, France) <massie@irit.fr>
004:         * Copyright (C) 2007 Mathieu BENOIT <mathieu-benoit@hotmail.fr>
005:         * Copyright (C) 2007 Sebastien BALARD <sbalard@wilos-project.org>
006:         *
007:         * This program is free software; you can redistribute it and/or modify it under the terms of the GNU
008:         * General Public License as published by the Free Software Foundation; either version 2 of the License,
009:         * or (at your option) any later version.
010:         *
011:         * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
012:         * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
013:         * GNU General Public License for more details.
014:         *
015:         * You should have received a copy of the GNU General Public License along with this program; if not,
016:         * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
017:         */
018:
019:        package wilos.hibernate.misc.concreterole;
020:
021:        import java.util.ArrayList;
022:        import java.util.List;
023:
024:        import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
025:
026:        import wilos.model.misc.concreterole.ConcreteRoleDescriptor;
027:        import wilos.model.misc.concretetask.ConcreteTaskDescriptor;
028:
029:        /**
030:         * ConcreteRoleDescriptorDao manage requests from the system to store
031:         * ConcreteRoleDescriptorDao to the database 
032:         */
033:        public class ConcreteRoleDescriptorDao extends HibernateDaoSupport {
034:
035:            /**
036:             * Saves or updates a ConcreteRoleDescriptorDao
037:             * 
038:             * @param _concreteRoledescriptor The ConcreteRoleDescriptor to be saved or updated
039:             */
040:            public String saveOrUpdateConcreteRoleDescriptor(
041:                    ConcreteRoleDescriptor _concreteRoledescriptor) {
042:                if (_concreteRoledescriptor != null) {
043:                    this .getHibernateTemplate().saveOrUpdate(
044:                            _concreteRoledescriptor);
045:                    return _concreteRoledescriptor.getId();
046:                }
047:                return "";
048:            }
049:
050:            /**
051:             * Returns a list of all the ConcreteRoleDescriptors
052:             * 
053:             * @return A list of all the ConcreteRoleDescriptors
054:             */
055:            public List<ConcreteRoleDescriptor> getAllConcreteRoleDescriptors() {
056:                List<ConcreteRoleDescriptor> concreteRoleDescriptors = new ArrayList<ConcreteRoleDescriptor>();
057:                for (Object obj : this .getHibernateTemplate().loadAll(
058:                        ConcreteRoleDescriptor.class)) {
059:                    ConcreteRoleDescriptor crd = (ConcreteRoleDescriptor) obj;
060:                    concreteRoleDescriptors.add(crd);
061:                }
062:                return concreteRoleDescriptors;
063:            }
064:
065:            /**
066:             * Returns the ConcreteRoleDescriptor which has the ID _id
067:             * 
068:             * @param _id The wanted ID
069:             * @return The wanted ConcreteRoleDescriptor
070:             */
071:            public ConcreteRoleDescriptor getConcreteRoleDescriptor(String _id) {
072:                if (!_id.equals(""))
073:                    return (ConcreteRoleDescriptor) this .getHibernateTemplate()
074:                            .get(ConcreteRoleDescriptor.class, _id);
075:                return null;
076:            }
077:
078:            /**
079:             * Deletes the ConcreteRoleDescriptor
080:             * 
081:             * @param _concreteRoledescriptor
082:             */
083:            public void deleteConcreteRoleDescriptor(
084:                    ConcreteRoleDescriptor _concreteRoledescriptor) {
085:                this .getHibernateTemplate().delete(_concreteRoledescriptor);
086:            }
087:
088:            /**
089:             * Returns all the ConcreteRoleDescriptors of the project which has the specified ID
090:             * 
091:             * @param _projectId The wanted Project ID
092:             * @return A list of ConcreteRoleDescriptor
093:             */
094:            public List<ConcreteRoleDescriptor> getAllConcreteRoleDescriptorsForProject(
095:                    String _projectId) {
096:                List<ConcreteRoleDescriptor> concreteRoleDescriptors = new ArrayList<ConcreteRoleDescriptor>();
097:                for (Object obj : this 
098:                        .getHibernateTemplate()
099:                        .find(
100:                                "from ConcreteRoleDescriptor crd where crd.project.id=?",
101:                                _projectId)) {
102:                    ConcreteRoleDescriptor crd = (ConcreteRoleDescriptor) obj;
103:                    concreteRoleDescriptors.add(crd);
104:                }
105:                return concreteRoleDescriptors;
106:            }
107:
108:            /**
109:             * Returns a list of ConcreteTaskDescriptor corresponding to 
110:             * the ConcreteRoleDescriptor which has the specified ID
111:             * 
112:             * @param _concreteRoleDescriptorId The wanted ConcreteRoleDescriptor ID
113:             * @return A list of ConcreteTaskDescriptor
114:             */
115:            public List<ConcreteTaskDescriptor> getMainConcreteTaskDescriptorsForConcreteRoleDescriptor(
116:                    String _concreteRoleDescriptorId) {
117:                List<ConcreteTaskDescriptor> concreteTaskDescriptors = new ArrayList<ConcreteTaskDescriptor>();
118:                for (Object obj : this 
119:                        .getHibernateTemplate()
120:                        .find(
121:                                "from ConcreteTaskDescriptor ctd where ctd.mainConcreteRoleDescriptor.id=?",
122:                                _concreteRoleDescriptorId)) {
123:                    ConcreteTaskDescriptor ctd = (ConcreteTaskDescriptor) obj;
124:                    concreteTaskDescriptors.add(ctd);
125:                }
126:                return concreteTaskDescriptors;
127:            }
128:
129:            /**
130:             * Returns a list of ConcreteRoleDescriptor corresponding to the 
131:             * RoleDescriptor which has the specified ID
132:             * 
133:             * @param _roleId The wanted RoleDescriptor ID
134:             * @return A list of ConcreteRoleDescriptor
135:             */
136:            public List<ConcreteRoleDescriptor> getAllConcreteRoleDescriptorsForARoleDescriptor(
137:                    String _roleId) {
138:                List<ConcreteRoleDescriptor> concreteRoleDescriptors = new ArrayList<ConcreteRoleDescriptor>();
139:                for (Object obj : this 
140:                        .getHibernateTemplate()
141:                        .find(
142:                                "from ConcreteRoleDescriptor ctd where ctd.roleDescriptor.id=?",
143:                                _roleId)) {
144:                    ConcreteRoleDescriptor crd = (ConcreteRoleDescriptor) obj;
145:                    concreteRoleDescriptors.add(crd);
146:                }
147:                return concreteRoleDescriptors;
148:            }
149:
150:            /* public List<ConcreteTaskDescriptor> getPrimaryConcreteTaskDescriptors(String _roleId) {
151:             List ctds = this.getHibernateTemplate().find(
152:             "from ConcreteTaskDescriptor ctd join ctd.concreteRoleDescriptors crds where crds.id=?", _roleId);
153:             List<ConcreteTaskDescriptor> listCtds = new ArrayList<ConcreteTaskDescriptor>();
154:             if (ctds.get(0) instanceof List) {
155:             for (Object o : (ArrayList) ctds.get(0)) {
156:             if (o instanceof ConcreteTaskDescriptor) {
157:             ConcreteTaskDescriptor bde = (ConcreteTaskDescriptor) o;
158:             listCtds.add(bde);
159:             }
160:             }
161:             }
162:             return listCtds;
163:             }*/
164:
165:            /*public String getConcreteRoleDescriptorName(String _concreteRoleDescriptorId) {
166:             Query query = this.getSession().createQuery(
167:             "select crd.concreteName from ConcreteRoleDescriptor crd where crd.id='" + _concreteRoleDescriptorId
168:             + "'");
169:             List results = query.list();
170:             if (results.size() == 1)
171:             return (String) results.get(0);
172:             return null;
173:             }*/
174:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.