Source Code Cross Referenced for BnProjectBean.java in  » Workflow-Engines » bonita-v3.1 » hero » entity » 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 » bonita v3.1 » hero.entity 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


0001:        package hero.entity;
0002:
0003:        import hero.interfaces.BnAgentLocal;
0004:        import hero.interfaces.BnAgentLocalHome;
0005:        import hero.interfaces.BnEdgeLocal;
0006:        import hero.interfaces.BnEdgeLocalHome;
0007:        import hero.interfaces.BnNodeLocal;
0008:        import hero.interfaces.BnNodeLocalHome;
0009:        import hero.interfaces.BnProjectLightValue;
0010:        import hero.interfaces.BnProjectPK;
0011:        import hero.interfaces.BnProjectValue;
0012:        import hero.interfaces.InvalidValueException;
0013:        import hero.interfaces.SequenceGeneratorLocal;
0014:        import hero.interfaces.SequenceGeneratorLocalHome;
0015:        import hero.interfaces.SequenceGeneratorUtil;
0016:        import hero.interfaces.BnInitiatorMapperLocal;
0017:        import hero.util.HeroException;
0018:        import hero.util.values.BonitaProjectValue;
0019:
0020:        import java.util.Date;
0021:        import java.util.Collection;
0022:
0023:        import javax.ejb.CreateException;
0024:        import javax.ejb.EJBException;
0025:        import javax.ejb.EntityBean;
0026:        import javax.ejb.EntityContext;
0027:        import javax.ejb.FinderException;
0028:        import javax.ejb.RemoveException;
0029:        import javax.naming.NamingException;
0030:
0031:        import org.apache.log4j.Category;
0032:
0033:        /**
0034:         * The Entity bean represents a BnProject
0035:         *
0036:         * @author Fran?ois Charoy
0037:         * @version $Revision: 1.46 $
0038:         *
0039:         * @ejb.bean name="BnProject"
0040:         *           display-name="BnProject Entity"
0041:         *           type="CMP"
0042:         *           jndi-name="ejb/hero/BnProject"
0043:         *           local-jndi-name="ejb/hero/BnProject_L"
0044:         *           view-type="both"
0045:         *           cmp-version="2.x"
0046:         *           reentrant="true"
0047:         *
0048:         * @ejb.permission unchecked="yes"
0049:         * @ejb:pk  class="hero.interfaces.BnProjectPK" generate="true" method-intf="remote"
0050:         *
0051:         * @jonas.bean
0052:         * 	   lock-policy="container-read-committed"
0053:         *
0054:         * @jonas.shared false
0055:         *
0056:         * @jonas.jdbc-mapping
0057:         *     jndi-name="bonita"
0058:         *     jdbc-table-name="BnProject"
0059:         *
0060:         * @ejb.finder signature="java.util.Collection findAll()"
0061:         *     query="SELECT object(p) FROM BnProject p"
0062:         *     transaction-type="Supports"
0063:         *
0064:         * @ejb.finder signature="java.util.Collection findModels(java.lang.String type, java.lang.String status)"
0065:         *     query="SELECT object(p) FROM BnProject as p WHERE p.type = ?1 AND p.status =?2"
0066:         *     transaction-type="Supports"
0067:         *
0068:         *
0069:         * @ejb.finder signature="hero.interfaces.BnProject findByName(java.lang.String pName )" result-type-mapping="Remote"
0070:         *     query="SELECT Object(p) From BnProject as p Where p.name = ?1"
0071:         *     transaction-type="Supports"
0072:         * @ejb.finder signature="hero.interfaces.BnProjectLocal findByName(java.lang.String pName )"  result-type-mapping="Local"
0073:         *     query="SELECT Object(p) From BnProject as p Where p.name = ?1"
0074:         *     transaction-type="Supports"
0075:         *
0076:         *
0077:         * @ejb.finder signature="hero.interfaces.BnProject findByNameVersion(java.lang.String pName, java.lang.String pVersion )" result-type-mapping="Remote"
0078:         *     query="SELECT Object(p) From BnProject as p Where p.name = ?1 AND p.version = ?2"
0079:         *     transaction-type="Supports"
0080:         * @ejb.finder signature="hero.interfaces.BnProjectLocal findByNameVersion(java.lang.String pName, java.lang.String pVersion )"  result-type-mapping="Local"
0081:         *     query="SELECT Object(p) From BnProject as p Where p.name = ?1 AND p.version = ?2"
0082:         *     transaction-type="Supports"
0083:         *
0084:         *
0085:         * @ejb.finder signature="java.util.Collection findByUser(java.lang.String userName )"
0086:         *     query="SELECT OBJECT(p) From BnProject as p, in (p.bnUsers) as u Where u.name = ?1"
0087:         *     transaction-type="Supports"
0088:         *
0089:         *
0090:         *     
0091:         * @ejb.finder signature="java.util.Collection findUserInstancesByProjectVersion(java.lang.String projectName, java.lang.String version,java.lang.String userName )"
0092:         *     query="SELECT DISTINCT OBJECT(p) From BnProject AS p, IN (p.bnUsers) u
0093:         * 				 WHERE p.name LIKE ?1
0094:         * 				 AND p.version = ?2
0095:         * 				 AND u.name = ?3"
0096:         *     transaction-type="Supports"
0097:         *
0098:         * @ejb.finder signature="java.util.Collection findProjectsByProperty(java.lang.String key, java.lang.String value )"
0099:         *     query="SELECT OBJECT(p) From BnProject as p, BnProjectProperty as prop
0100:         * 					 Where prop.theKey = ?1
0101:         * 					 AND prop.theValue = ?2
0102:         * 					 AND p.id = prop.bnProject.id"
0103:         *     transaction-type="Supports"
0104:         *
0105:         * @ejb.finder signature="java.util.Collection findByAdmin(java.lang.String userName, java.lang.String roleName, java.lang.String type)"
0106:         *     query="SELECT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0107:         * 					Where u.name = ?1
0108:         * 					AND r.name = ?2
0109:         * 					AND p.type = ?3
0110:         * 					AND r.id = pr.id"
0111:         *     transaction-type="Supports"
0112:         *
0113:         * @ejb.finder signature="java.util.Collection findByAdminFiltersAll(int state, java.lang.String creator, java.lang.String user, java.lang.String role, java.lang.String propkey, java.lang.String propval, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0114:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r, in (p.bnProperties) as pp
0115:         * 					Where p.state = ?1
0116:         * 					AND p.creator = ?2
0117:         * 					AND u.name = ?3
0118:         * 					AND r.name = ?4
0119:         * 					AND pp.theKey = ?5
0120:         * 					AND pp.theValue = ?6
0121:         * 					AND p.type = ?9
0122:         *  				AND r.id = pr.id"
0123:         *     transaction-type="Supports"
0124:         * 
0125:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoProp(int state, java.lang.String creator, java.lang.String user, java.lang.String role, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0126:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0127:         * 					Where p.state = ?1
0128:         * 					AND p.creator = ?2
0129:         * 					AND u.name = ?3
0130:         * 					AND r.name = ?4
0131:         * 					AND p.type = ?7
0132:         *  				AND r.id = pr.id"
0133:         *     transaction-type="Supports"
0134:         * 
0135:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoRole(int state, java.lang.String creator, java.lang.String user, java.lang.String propkey, java.lang.String propval, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0136:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r, in (p.bnProperties) as pp
0137:         * 					Where p.state = ?1
0138:         * 					AND p.creator = ?2
0139:         * 					AND u.name = ?3
0140:         * 					AND pp.theKey = ?4
0141:         * 					AND pp.theValue = ?5
0142:         * 					AND r.name = ?7
0143:         * 					AND p.type = ?8
0144:         *  				AND r.id = pr.id"
0145:         *     transaction-type="Supports"
0146:         * 
0147:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoUser(int state, java.lang.String creator, java.lang.String role, java.lang.String propkey, java.lang.String propval, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0148:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r, in (p.bnProperties) as pp
0149:         * 					Where p.state = ?1
0150:         * 					AND p.creator = ?2
0151:         * 					AND u.name = ?6
0152:         * 					AND r.name = ?3
0153:         * 					AND pp.theKey = ?4
0154:         * 					AND pp.theValue = ?5
0155:         * 					AND p.type = ?8
0156:         * 					AND r.id = pr.id"
0157:         *     transaction-type="Supports"
0158:         * 
0159:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoCreator(int state, java.lang.String user, java.lang.String role, java.lang.String propkey, java.lang.String propval, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0160:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r, in (p.bnProperties) as pp
0161:         * 					Where p.state = ?1
0162:         * 					AND u.name = ?2
0163:         * 					AND r.name = ?3
0164:         * 					AND pp.theKey = ?4
0165:         * 					AND pp.theValue = ?5
0166:         * 					AND p.type = ?8
0167:         * 					AND r.id = pr.id"
0168:         *     transaction-type="Supports"
0169:         * 
0170:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoState(java.lang.String creator, java.lang.String user, java.lang.String role, java.lang.String propkey, java.lang.String propval, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0171:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r, in (p.bnProperties) as pp
0172:         * 					Where p.creator = ?1
0173:         * 					AND u.name = ?2
0174:         * 					AND r.name = ?3
0175:         * 					AND pp.theKey = ?4
0176:         * 					AND pp.theValue = ?5
0177:         * 					AND p.type = ?8
0178:         * 					AND r.id = pr.id"
0179:         *     transaction-type="Supports"
0180:         *     
0181:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoRoleNoProp(int state, java.lang.String creator, java.lang.String user, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0182:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0183:         * 					Where p.state = ?1
0184:         * 					AND p.creator = ?2
0185:         * 					AND u.name = ?3
0186:         * 					AND r.name = ?5
0187:         * 					AND p.type = ?6
0188:         * 					AND r.id = pr.id"
0189:         *     transaction-type="Supports"
0190:         *     
0191:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoUserNoProp(int state, java.lang.String creator, java.lang.String role, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0192:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0193:         * 					Where p.state = ?1
0194:         * 					AND p.creator = ?2
0195:         * 					AND r.name = ?3
0196:         * 					AND u.name = ?4
0197:         * 					AND p.type = ?6
0198:         * 					AND r.id = pr.id"
0199:         *     transaction-type="Supports"
0200:         *     
0201:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoUserNoRole(int state, java.lang.String creator, java.lang.String propkey, java.lang.String propval, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0202:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r, in (p.bnProperties) as pp
0203:         * 					Where p.state = ?1
0204:         * 					AND p.creator = ?2
0205:         * 					AND u.name = ?5
0206:         * 					AND pp.theKey = ?3
0207:         * 					AND pp.theValue = ?4
0208:         * 					AND r.name = ?6
0209:         * 					AND p.type = ?7
0210:         * 					AND r.id = pr.id"
0211:         *     transaction-type="Supports"
0212:         *     
0213:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoStateNoProp(java.lang.String creator, java.lang.String user, java.lang.String role, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0214:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0215:         * 					Where p.creator = ?1
0216:         * 					AND u.name = ?2
0217:         * 					AND r.name = ?3
0218:         * 					AND p.type = ?6
0219:         * 					AND r.id = pr.id"
0220:         *     transaction-type="Supports"
0221:         *     
0222:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoStateNoRole(java.lang.String creator, java.lang.String user, java.lang.String propkey, java.lang.String propval, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0223:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r, in (p.bnProperties) as pp
0224:         * 					Where p.creator = ?1
0225:         * 					AND u.name = ?2
0226:         * 					AND pp.theKey = ?3
0227:         * 					AND pp.theValue = ?4
0228:         * 					AND r.name = ?6
0229:         * 					AND p.type = ?7
0230:         * 					AND r.id = pr.id"
0231:         *     transaction-type="Supports"
0232:         *     
0233:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoCreatorNoRole(int state, java.lang.String user, java.lang.String propkey, java.lang.String propval, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0234:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r, in (p.bnProperties) as pp
0235:         * 					Where p.state = ?1
0236:         * 					AND u.name = ?2
0237:         * 					AND pp.theKey = ?3
0238:         * 					AND pp.theValue = ?4
0239:         * 					AND r.name = ?5
0240:         * 					AND p.type = ?7
0241:         * 					AND r.id = pr.id"
0242:         *     transaction-type="Supports"
0243:         *     
0244:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoStateNoCreator(java.lang.String user, java.lang.String role, java.lang.String propkey, java.lang.String propval, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0245:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r, in (p.bnProperties) as pp
0246:         * 					Where u.name = ?1
0247:         * 					AND r.name = ?2
0248:         * 					AND pp.theKey = ?3
0249:         * 					AND pp.theValue = ?4
0250:         * 					AND p.type = ?7
0251:         * 					AND r.id = pr.id"
0252:         *     transaction-type="Supports"
0253:         *     
0254:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoUserNoRoleNoProp(int state, java.lang.String creator, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0255:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0256:         * 					Where p.state = ?1
0257:         * 					AND p.creator = ?2
0258:         * 					AND u.name = ?3
0259:         * 					AND r.name = ?4
0260:         * 					AND p.type = ?5
0261:         * 					AND r.id = pr.id"
0262:         *     transaction-type="Supports"
0263:         *     
0264:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoCreatorNoRoleNoProp(int state, java.lang.String user, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0265:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0266:         * 					Where p.state = ?1
0267:         * 					AND u.name = ?2
0268:         * 					AND r.name = ?4
0269:         * 					AND p.type = ?5
0270:         * 					AND r.id = pr.id"
0271:         *     transaction-type="Supports"
0272:         *     
0273:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoCreatorNoUserNoProp(int state, java.lang.String role, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0274:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0275:         * 					Where p.state = ?1
0276:         * 					AND u.name = ?3
0277:         * 					AND r.name = ?2
0278:         * 					AND p.type = ?5
0279:         * 					AND r.id = pr.id"
0280:         *     transaction-type="Supports"
0281:         *     
0282:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoCreatorNoUserNoRole(int state, java.lang.String propkey, java.lang.String propval, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0283:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnProperties) as pp, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0284:         * 					Where p.state = ?1
0285:         * 					AND pp.theKey = ?2
0286:         * 					AND pp.theValue = ?3
0287:         * 					AND u.name = ?4
0288:         * 					AND r.name = ?5
0289:         * 					AND p.type = ?6
0290:         * 					AND r.id = pr.id"
0291:         *     transaction-type="Supports"
0292:         *     
0293:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoStateNoRoleNoProp(java.lang.String creator, java.lang.String user, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0294:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0295:         * 					Where p.creator = ?1
0296:         * 					AND u.name = ?2
0297:         * 					AND r.name = ?4
0298:         * 					AND p.type = ?5
0299:         * 					AND r.id = pr.id"
0300:         *     transaction-type="Supports"
0301:         *     
0302:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoStateNoUserNoProp(java.lang.String creator, java.lang.String role, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0303:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0304:         * 					Where p.creator = ?1
0305:         * 					AND u.name = ?3
0306:         * 					AND r.name = ?2
0307:         * 					AND p.type = ?5
0308:         * 					AND r.id = pr.id"
0309:         *     transaction-type="Supports"
0310:         *     
0311:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoStateNoUserNoRole(java.lang.String creator, java.lang.String propkey, java.lang.String propval, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0312:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r, in (p.bnProperties) as pp
0313:         * 					Where p.creator = ?1
0314:         * 					AND u.name = ?4
0315:         * 					AND pp.theKey = ?2
0316:         * 					AND pp.theValue = ?3
0317:         * 					AND r.name = ?5
0318:         * 					AND p.type = ?6
0319:         * 					AND r.id = pr.id"
0320:         *     transaction-type="Supports"
0321:         *     
0322:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoStateNoCreatorNoProp(java.lang.String user, java.lang.String role, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0323:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0324:         * 					Where u.name = ?1
0325:         * 					AND r.name = ?2
0326:         * 					AND p.type = ?5
0327:         * 					AND r.id = pr.id"
0328:         *     transaction-type="Supports"
0329:         *     
0330:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoStateNoCreatorNoRole(java.lang.String user, java.lang.String propkey, java.lang.String propval, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0331:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r, in (p.bnProperties) as pp
0332:         * 					Where u.name = ?1
0333:         * 					AND pp.theKey = ?2
0334:         * 					AND pp.theValue = ?3
0335:         * 					AND r.name = ?5
0336:         * 					AND p.type = ?6
0337:         * 					AND r.id = pr.id"
0338:         *     transaction-type="Supports"
0339:         *     
0340:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoStateNoCreatorNoUser(java.lang.String role, java.lang.String propkey, java.lang.String propval, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0341:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r, in (p.bnProperties) as pp
0342:         * 					Where u.name = ?4
0343:         * 					AND r.name = ?1
0344:         * 					AND pp.theKey = ?2
0345:         * 					AND pp.theValue = ?3
0346:         * 					AND p.type = ?6
0347:         * 					AND r.id = pr.id"
0348:         *     transaction-type="Supports"
0349:         *     
0350:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoCreatorNoUserNoRoleNoProp(int state, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0351:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0352:         * 					Where p.state = ?1
0353:         * 					AND u.name = ?2
0354:         * 					AND r.name = ?3
0355:         * 					AND p.type = ?4
0356:         * 					AND r.id = pr.id"
0357:         *     transaction-type="Supports"
0358:         *     
0359:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoStateNoUserNoRoleNoProp(java.lang.String creator, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0360:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0361:         * 					Where p.creator = ?1
0362:         * 					AND u.name = ?2
0363:         * 					AND r.name = ?3
0364:         * 					AND p.type = ?4
0365:         * 					AND r.id = pr.id"
0366:         *     transaction-type="Supports"
0367:         * 
0368:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoStateNoCreatorNoRoleNoProp(java.lang.String user, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0369:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0370:         * 					Where u.name = ?1
0371:         * 					AND r.name = ?3
0372:         * 					AND p.type = ?4
0373:         * 					AND r.id = pr.id"
0374:         *     transaction-type="Supports"
0375:         * 
0376:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoStateNoCreatorNoUserNoProp(java.lang.String role, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0377:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0378:         * 					Where u.name = ?2
0379:         * 					AND r.name = ?1
0380:         * 					AND p.type = ?4
0381:         * 					AND r.id = pr.id"
0382:         *     transaction-type="Supports"
0383:         * 
0384:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoStateNoCreatorNoUserNoRole(java.lang.String propkey, java.lang.String propval, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0385:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r, in (p.bnProperties) as pp
0386:         * 					Where u.name = ?3
0387:         * 					AND pp.theKey = ?1
0388:         * 					AND pp.theValue = ?2
0389:         * 					AND r.name = ?4
0390:         * 					AND p.type = ?5
0391:         * 					AND r.id = pr.id"
0392:         *     transaction-type="Supports"
0393:         * 
0394:         * @ejb.finder signature="java.util.Collection findByAdminFiltersNoCreatorNoUser(int state, java.lang.String role, java.lang.String propkey, java.lang.String propval, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0395:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r, in (p.bnProperties) as pp
0396:         * 					Where p.state = ?1
0397:         * 					AND r.name = ?2
0398:         * 					AND pp.theKey = ?3
0399:         * 					AND pp.theValue = ?4
0400:         * 					AND p.type = ?7
0401:         * 					AND r.id = pr.id"
0402:         *     transaction-type="Supports"
0403:         * 
0404:         *  * @ejb.finder signature="java.util.Collection findByAdminFiltersNoCreatorNoProp(int state, java.lang.String user, java.lang.String role, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0405:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r
0406:         * 					Where p.state = ?1
0407:         * 					AND u.name = ?2
0408:         * 					AND r.name = ?3
0409:         * 					AND p.type = ?6
0410:         * 					AND r.id = pr.id"
0411:         *     transaction-type="Supports"
0412:         * 
0413:         *  * @ejb.finder signature="java.util.Collection findByAdminFiltersNoStateNoUser(java.lang.String creator, java.lang.String role, java.lang.String propkey, java.lang.String propval, java.lang.String userName, java.lang.String userRole, java.lang.String type)"
0414:         *     query="SELECT DISTINCT OBJECT(p) From BnProject as p, in (p.bnRoles) as pr, in (p.bnUsers) as u, in (u.bnRoles) as r, in (p.bnProperties) as pp
0415:         * 					Where p.creator = ?1
0416:         * 					AND u.name = ?5
0417:         * 					AND pp.theKey = ?3
0418:         * 					AND pp.theValue = ?4
0419:         * 					AND r.name = ?2
0420:         * 					AND p.type = ?7
0421:         * 					AND r.id = pr.id"
0422:         *     transaction-type="Supports"
0423:         * 
0424:         * @ejb.value-object
0425:         *    match="*"
0426:         *    name="BnProject"
0427:         *
0428:         * @ejb.value-object
0429:         *    match="light"
0430:         *    name="BnProjectLight"
0431:         *
0432:         * @ejb:transaction type="Required"
0433:         * 
0434:         * @jboss.persistence
0435:         *    table-name="BnProject"
0436:         *    create-table="true"
0437:         *    remove-table="false"
0438:         *
0439:         * @jboss.container-configuration name="Standard CMP 2.x EntityBean for Bonita"
0440:         *
0441:         * @version $Revision: 1.46 $
0442:         * @author $Author: dparisek $
0443:         **/
0444:        public abstract class BnProjectBean implements  EntityBean {
0445:
0446:            // -------------------------------------------------------------------------
0447:            // Members
0448:            // -------------------------------------------------------------------------
0449:            // Static
0450:            // -------------------------------------------------------------------------
0451:            // Utility variable
0452:            private static final Category log = Category
0453:                    .getInstance(BnProjectBean.class);
0454:            public EntityContext mContext;
0455:
0456:            // -------------------------------------------------------------------------
0457:            // Properties (Getters/Setters)
0458:            // -------------------------------------------------------------------------
0459:
0460:            /**
0461:             * Retrieve the BnProject's id.
0462:             *
0463:             * @return Returns an int representing the id of this BnUser.
0464:             *
0465:             * @ejb:pk-field
0466:             * @ejb:interface-method view-type="both"
0467:             * @ejb.value-object
0468:             *      match="light"
0469:             *
0470:             * @ejb:persistence column-name="id"
0471:             * @jonas.cmp-field-jdbc-mapping
0472:             *    field-name="id"
0473:             *    jdbc-field-name="id"
0474:             * @ejb:transaction type="Supports"
0475:             **/
0476:            public abstract String getId();
0477:
0478:            /**
0479:             * Set the BnProject's id.
0480:             *
0481:             * @param pId The id of this BnUser. Is set at creation time.
0482:             * @ejb:transaction type="Required"
0483:             **/
0484:            public abstract void setId(String pId);
0485:
0486:            /**
0487:             * Get parent of this project (or the name of the project if is not a child)
0488:             *
0489:             * @return Returns a String representing the parent name
0490:             *
0491:             * @ejb:interface-method view-type="both"
0492:             * @ejb.value-object
0493:             *      match="light"
0494:             *
0495:             * @ejb:persistence column-name="parent"
0496:             * @ejb:transaction type="Supports"
0497:             **/
0498:
0499:            public abstract String getParent();
0500:
0501:            /**
0502:             * Set the parent of this project (or the name of the project if is not a child)
0503:             *
0504:             * @param parent of this project. Is set at creation time.
0505:             * @ejb:interface-method view-type="both"
0506:             * @ejb:transaction type="Required"
0507:             **/
0508:            public abstract void setParent(String parent);
0509:
0510:            /**
0511:             * Retrieve the BnProject's Name.
0512:             *
0513:             * @return Returns an int representing the Name of this BnProject.
0514:             *
0515:             * @ejb:interface-method view-type="both"
0516:             * @ejb.value-object
0517:             *      match="light"
0518:             *
0519:             * @ejb:persistence column-name="name"
0520:             * @ejb:transaction type="Supports"
0521:             **/
0522:            public abstract String getName();
0523:
0524:            /**
0525:             * Set the BnProject's Name.
0526:             *
0527:             * @param pName The Name of this BnProject. Is set at creation time.
0528:             * @ejb:transaction type="Required"
0529:             */
0530:            public abstract void setName(String pName);
0531:
0532:            /**
0533:             * Retrieve the BnProject's Version.
0534:             *
0535:             * @return Returns an int representing the Version of this BnProject.
0536:             *
0537:             * @ejb:interface-method view-type="both"
0538:             * @ejb.value-object
0539:             *      match="light"
0540:             *
0541:             * @ejb:persistence column-name="version"
0542:             * @ejb:transaction type="Supports"
0543:             **/
0544:            public abstract String getVersion();
0545:
0546:            /**
0547:             * Set the BnProject's Version.
0548:             *
0549:             * @param pVersion The Version of this BnProject. Is set at creation time.
0550:             * @ejb:transaction type="Required"
0551:             */
0552:            public abstract void setVersion(String pVersion);
0553:
0554:            /**
0555:             * Get the status of this project (Active/Hidden)
0556:             *
0557:             * @return Returns a String representing the status name
0558:             *
0559:             * @ejb:interface-method view-type="both"
0560:             * @ejb.value-object match="light"
0561:             *
0562:             * @ejb:persistence column-name="status"
0563:             * @ejb:transaction type="Supports"
0564:             */
0565:
0566:            public abstract String getStatus();
0567:
0568:            /**
0569:             * Set the status of this project (Active/Hidden)
0570:             *
0571:             * @param status of this project. Is set at creation time.
0572:             * @ejb:interface-method view-type="both"
0573:             * @ejb:transaction type="Required"
0574:             */
0575:            public abstract void setStatus(String status);
0576:
0577:            /**
0578:             * Get the type of this project (model/cooperative/instance)
0579:             *
0580:             * @return Returns a String representing the type name
0581:             *
0582:             * @ejb:interface-method view-type="both"
0583:             * @ejb.value-object match="light"
0584:             *
0585:             * @ejb:persistence column-name="type"
0586:             * @ejb:transaction type="Supports"
0587:             */
0588:
0589:            public abstract String getType();
0590:
0591:            /**
0592:             * Set the type of this project (model/cooperative/instance)
0593:             *
0594:             * @param type of this project. Is set at creation time.
0595:             * @ejb:interface-method view-type="both"
0596:             * @ejb:transaction type="Required"
0597:             */
0598:            public abstract void setType(String type);
0599:
0600:            /**
0601:             * Retrieve the BnProject Creator.
0602:             *
0603:             * @return Returns a string representing the name of the creator.
0604:             *
0605:             * @ejb.interface-method view-type="both"
0606:             * @ejb.value-object match="light"
0607:             *
0608:             * @ejb:persistence column-name="creator"
0609:             * @ejb:transaction type="Supports"
0610:             */
0611:            public abstract String getCreator();
0612:
0613:            /**
0614:             * Set the Creator Name.
0615:             *
0616:             * @param pCreator The Creator of this project
0617:             * @ejb:transaction type="Required"
0618:             **/
0619:            public abstract void setCreator(String pCreator);
0620:
0621:            /**
0622:             * @return Returns the State of this BnProject
0623:             *
0624:             * @ejb:interface-method view-type="both"
0625:             * @ejb.value-object
0626:             *      match="light"
0627:             *
0628:             * @ejb:persistence column-name="state"
0629:             * @ejb:transaction type="Supports"
0630:             **/
0631:            public abstract int getState();
0632:
0633:            /**
0634:             * Specify the State of this BnProject
0635:             *
0636:             * @param pState State of this BnProject
0637:             * @ejb:interface-method view-type="both"
0638:             * @ejb:transaction type="Required"
0639:             **/
0640:            public abstract void setState(int pState);
0641:
0642:            /**
0643:             * @return Return the nodes of the project
0644:             *
0645:             * @ejb.interface-method view-type="both"
0646:             * @ejb.relation name="Nodes" role-name="has-nodes"
0647:             *
0648:             * @ejb.value-object
0649:             *       match="normal"
0650:             *       type="Collection"
0651:             *       relation="external"
0652:             *       compose="hero.interfaces.BnNodeValue"
0653:             *       compose-name="BnNode"
0654:             *       members="hero.interfaces.BnNodeLocal"
0655:             *       members-name="BnNode"
0656:             * @ejb:transaction type="Supports"
0657:             *
0658:             * @jboss.relation-table create-table="true" remove-table="false"
0659:             **/
0660:            public abstract Collection getBnNodes();
0661:
0662:            /**
0663:             * Specify the Nodes of this BnProject
0664:             *
0665:             * @param pNodes Nodes of this BnProject
0666:             * @ejb:interface-method view-type="local"
0667:             * @ejb:transaction type="Required"
0668:             **/
0669:            public abstract void setBnNodes(Collection pNodes);
0670:
0671:            /**
0672:             * @return Return the edges of the project
0673:             *
0674:             * @ejb:interface-method view-type="local"
0675:             * @ejb:relation name="Edges" role-name="has-edges"
0676:             *
0677:             * @ejb.value-object
0678:             *       match="normal"
0679:             *       type="Collection"
0680:             *       relation="external"
0681:             *       compose="hero.interfaces.BnEdgeValue"
0682:             *       compose-name="BnEdge"
0683:             *       members="hero.interfaces.BnEdgeLocal"
0684:             *       members-name="BnEdge"
0685:             * @ejb:transaction type="Supports"
0686:             *
0687:             * @jboss.relation-table create-table="true" remove-table="false"
0688:             **/
0689:            public abstract Collection getBnEdges();
0690:
0691:            /**
0692:             * Specify the Edges of this BnProject
0693:             *
0694:             * @param pEdges Edges of this BnProject
0695:             * @ejb:interface-method view-type="local"
0696:             * @ejb:transaction type="Required"
0697:             **/
0698:            public abstract void setBnEdges(Collection pEdges);
0699:
0700:            /**
0701:             * @return Return the Agents of the project
0702:             *
0703:             * @ejb.interface-method view-type="local"
0704:             * @ejb.relation name="Agents" role-name="has-agents"
0705:             *
0706:             * @ejb.value-object
0707:             *       match="normal"
0708:             *       type="Collection"
0709:             *       relation="external"
0710:             *       compose="hero.interfaces.BnAgentValue"
0711:             *       compose-name="BnAgent"
0712:             *       members="hero.interfaces.BnAgentLocal"
0713:             *       members-name="BnAgent"
0714:             * @ejb:transaction type="Supports"
0715:             *
0716:             * @jboss.relation-table create-table="true" remove-table="false"
0717:             **/
0718:            public abstract Collection getBnAgents();
0719:
0720:            /**
0721:             * Specify the Agents of this BnProject
0722:             *
0723:             * @param pAgents Agents of this BnProject
0724:             * @ejb:interface-method view-type="local"
0725:             * @ejb:transaction type="Required"
0726:             **/
0727:            public abstract void setBnAgents(Collection pAgents);
0728:
0729:            /**
0730:             * @return Return the agentedges of the project
0731:             *
0732:             * @ejb:interface-method view-type="local"
0733:             * @ejb:relation name="AgentEdges" role-name="has-agentedges"
0734:             *
0735:             * @ejb.value-object
0736:             *       match="normal"
0737:             *       type="Collection"
0738:             *       relation="external"
0739:             *       compose="hero.interfaces.BnAgentEdgeValue"
0740:             *       compose-name="BnAgentEdge"
0741:             *       members="hero.interfaces.BnAgentEdgeLocal"
0742:             *       members-name="BnAgentEdge"
0743:             * @ejb:transaction type="Supports"
0744:             *
0745:             * @jboss.relation-table create-table="true" remove-table="false"
0746:             *
0747:             **/
0748:            public abstract Collection getBnAgentEdges();
0749:
0750:            /**
0751:             * Specify the AgentEdges of this BnProject
0752:             *
0753:             * @param pAgentEdges AgentEdges of this BnProject
0754:             * @ejb:interface-method view-type="local"
0755:             * @ejb:transaction type="Required"
0756:             **/
0757:            public abstract void setBnAgentEdges(Collection pAgentEdges);
0758:
0759:            /**
0760:             * @return Return the users of the project
0761:             *
0762:             * @ejb:interface-method view-type="local"
0763:             * @ejb:relation name="Users" role-name="has-users" target-multiple="yes"
0764:             *
0765:             * @ejb.value-object
0766:             *       match="normal"
0767:             *       type="Collection"
0768:             *       relation="external"
0769:             *       aggregate="hero.interfaces.BnUserLightValue"
0770:             *       aggregate-name="BnUser"
0771:             *       members="hero.interfaces.BnUserLocal"
0772:             *       members-name="BnUser"
0773:             * @ejb:transaction type="Supports"
0774:             *
0775:             * @jboss.relation-table create-table="true" remove-table="false"
0776:             *
0777:             * @jboss.relation
0778:             *    related-pk-field = "id"
0779:             *    fk-column = "projectUserIdFK"
0780:             **/
0781:            public abstract Collection getBnUsers();
0782:
0783:            /**
0784:             * Specify the Users of this BnProject
0785:             *
0786:             * @param pUsers Users of this BnProject
0787:             *
0788:             * @ejb:interface-method view-type="both"
0789:             * @ejb:transaction type="Required"
0790:             **/
0791:            public abstract void setBnUsers(Collection pUsers);
0792:
0793:            /**
0794:             * @return Return the roles of the project
0795:             *
0796:             * @ejb:interface-method view-type="local"
0797:             * @ejb:relation name="ProjectRoles" role-name="has-roles" target-multiple="yes"
0798:             *
0799:             * @ejb.value-object
0800:             *       match="normal"
0801:             *       type="Collection"
0802:             *       relation="external"
0803:             *       aggregate="hero.interfaces.BnRoleValue"
0804:             *       aggregate-name="BnRole"
0805:             *       members="hero.interfaces.BnRoleLocal"
0806:             *       members-name="BnRole"
0807:             * @ejb:transaction type="Supports"
0808:             *
0809:             * @jboss.relation-table create-table="true" remove-table="false"
0810:             **/
0811:            public abstract Collection getBnRoles();
0812:
0813:            /**
0814:             * Specify the Roles of this BnProject
0815:             *
0816:             * @param pRoles Roles of this BnProject
0817:             *
0818:             * @ejb:interface-method view-type="local"
0819:             * @ejb:transaction type="Required"
0820:             **/
0821:            public abstract void setBnRoles(Collection pRoles);
0822:
0823:            /** Retrieve the mapper (for the initiator) of the project.
0824:             *
0825:             * @return Returns the project initiator mapper.
0826:             * @ejb:interface-method view-type="both"
0827:             * @ejb:relation name="mapper-project" project-name="project2mapper" role-name="has-intiatorMapper"
0828:             * @ejb:value-object match="*"
0829:             *       relation="external"
0830:             *       aggregate="hero.interfaces.BnInitiatorMapperValue"
0831:             *       aggregate-name="BnInitiatorMapper"
0832:             *
0833:             * @jonas.field-mapping
0834:             *    key-jdbc-name="id"
0835:             *
0836:             * @ejb:transaction type="Supports"
0837:             * @jboss.relation
0838:             *    related-pk-field = "id"
0839:             *    fk-column = "projectMapperIdFK"
0840:             **/
0841:            public abstract BnInitiatorMapperLocal getBnInitiatorMapper();
0842:
0843:            /**
0844:             * Set the Project of this (initiator) mapper
0845:             *
0846:             * @param pInitiatorMapper initiatorMapper of the  project
0847:             * @ejb:transaction type="Required"
0848:             **/
0849:            public abstract void setBnInitiatorMapper(
0850:                    BnInitiatorMapperLocal pInitiatorMapper);
0851:
0852:            /**
0853:             * @return Return the creation date of the BnProject
0854:             * @ejb:interface-method view-type="both"
0855:             * @ejb:persistence column-name="creationdate"
0856:             * @ejb.value-object
0857:             *      match="light"
0858:             * @ejb:transaction type="Supports"
0859:             *
0860:             **/
0861:            public abstract Date getCreationDate();
0862:
0863:            /**
0864:             * @param pDate the creation date of the BnProject
0865:             * @ejb:interface-method view-type="both"
0866:             * @ejb.value-object
0867:             *      match="light"
0868:             * @ejb:transaction type="Required"
0869:             *
0870:             **/
0871:            public abstract void setCreationDate(Date pDate);
0872:
0873:            /**
0874:             * @return Return the date in which the BnProject was finished
0875:             * @ejb:interface-method view-type="both"
0876:             * @ejb:persistence column-name="enddate"
0877:             * @ejb:transaction type="Supports"
0878:             * @ejb.value-object
0879:             *      match="light"
0880:             *
0881:             **/
0882:            public abstract Date getEndDate();
0883:
0884:            /**
0885:             * @param the date in which the BnProject was finished
0886:             * @ejb:interface-method view-type="both"
0887:             * @ejb:transaction type="Required"
0888:             *
0889:             **/
0890:            public abstract void setEndDate(Date pDate);
0891:
0892:            /**
0893:             * @param nodeName name of the node to return
0894:             * @ejb:interface-method view-type="local"
0895:             * @ejb:transaction type="Supports"
0896:             *
0897:             **/
0898:            public BnNodeLocal getBnNode(String nodeName) throws HeroException {
0899:                BnNodeLocalHome nodehome;
0900:                BnNodeLocal node;
0901:                try {
0902:                    nodehome = hero.interfaces.BnNodeUtil.getLocalHome();
0903:                } catch (javax.naming.NamingException be) {
0904:                    throw new HeroException(be.getMessage());
0905:                }
0906:                try {
0907:                    node = nodehome.findByName(nodeName, this .getId());
0908:                } catch (FinderException fe) {
0909:                    throw new HeroException("No BnNode with this name");
0910:                }
0911:
0912:                return node;
0913:            }
0914:
0915:            /**
0916:             * @param AgentName name of the node to return
0917:             * @ejb:interface-method view-type="local"
0918:             * @ejb:transaction type="Supports"
0919:             *
0920:             **/
0921:            public BnAgentLocal getBnAgent(String agentName)
0922:                    throws HeroException {
0923:                BnAgentLocalHome agenthome;
0924:                BnAgentLocal agent;
0925:                try {
0926:                    agenthome = hero.interfaces.BnAgentUtil.getLocalHome();
0927:                } catch (javax.naming.NamingException be) {
0928:                    throw new HeroException(be.getMessage());
0929:                }
0930:                try {
0931:                    agent = agenthome.findByName(agentName, this .getId());
0932:                } catch (FinderException fe) {
0933:                    throw new HeroException("No BnAgent with this name");
0934:                }
0935:                return agent;
0936:            }
0937:
0938:            /**
0939:             * @param edgeName name of the node to return
0940:             * @ejb:interface-method view-type="local"
0941:             * @ejb:transaction type="Supports"
0942:             *
0943:             **/
0944:            public BnEdgeLocal getBnEdge(String edgeName) throws HeroException {
0945:                BnEdgeLocalHome edgehome;
0946:                BnEdgeLocal edge;
0947:                try {
0948:                    edgehome = hero.interfaces.BnEdgeUtil.getLocalHome();
0949:                } catch (javax.naming.NamingException be) {
0950:                    throw new HeroException(be.getMessage());
0951:                }
0952:                try {
0953:                    edge = edgehome.findByName(edgeName, this .getId());
0954:                } catch (FinderException fe) {
0955:                    throw new HeroException("No BnEdge with this name");
0956:                }
0957:
0958:                return edge;
0959:            }
0960:
0961:            /**
0962:             * @return  the properties of the project
0963:             * @ejb:interface-method view-type="both"
0964:             * @ejb:relation name="projectprp" role-name="is-property-of"
0965:             *
0966:             * @ejb.value-object
0967:             *       match="normal"
0968:             *       type="Collection"
0969:             *       relation="external"
0970:             *       compose="hero.interfaces.BnProjectPropertyValue"
0971:             *       compose-name="BnPropertie"
0972:             *       members="hero.interfaces.BnProjectPropertyLocal"
0973:             *       members-name="BnPropertie"
0974:             * @ejb:transaction type="Supports"
0975:             *
0976:             * @jboss.relation-table create-table="true" remove-table="false"
0977:             *
0978:             **/
0979:            public abstract Collection getBnProperties();
0980:
0981:            /**
0982:             * Set the properties of the project
0983:             * @ejb:interface-method view-type="both"
0984:             * @param pPrp the properties of the project
0985:             * @ejb:transaction type="Required"
0986:             **/
0987:            public abstract void setBnProperties(Collection pPrp);
0988:
0989:            /**
0990:             * @return  the iterations of the project
0991:             * @ejb:interface-method view-type="both"
0992:             * @ejb:relation name="projectIte" role-name="is-iteration-of"
0993:             *
0994:             * @ejb.value-object
0995:             *       match="normal"
0996:             *       type="Collection"
0997:             *       relation="external"
0998:             *       compose="hero.interfaces.BnIterationLightValue"
0999:             *       compose-name="BnIteration"
1000:             *       members="hero.interfaces.BnIterationLocal"
1001:             *       members-name="BnIteration"
1002:             * @ejb:transaction type="Supports"
1003:             *
1004:             * @jboss.relation-table create-table="true" remove-table="false"
1005:             *
1006:             **/
1007:            public abstract Collection getBnIterations();
1008:
1009:            /**
1010:             * Set the iterations of the project
1011:             * @ejb:interface-method view-type="both"
1012:             * @param ite the iterations of the project
1013:             * @ejb:transaction type="Required"
1014:             **/
1015:            public abstract void setBnIterations(Collection ite);
1016:
1017:            /**
1018:             * @return  the Hooks of the project
1019:             * @ejb:interface-method view-type="both"
1020:             * @ejb:relation name="projecthook" role-name="is-hook-of"
1021:             * @ejb.value-object
1022:             *       match="normal"
1023:             *       type="Collection"
1024:             *       relation="external"
1025:             *       compose="hero.interfaces.BnProjectHookValue"
1026:             *       compose-name="BnHook"
1027:             *       members="hero.interfaces.BnProjectHookLocal"
1028:             *       members-name="BnHook"
1029:             * @ejb:transaction type="Supports"
1030:             *
1031:             * @jboss.relation-table create-table="true" remove-table="false"
1032:             *
1033:             **/
1034:            public abstract Collection getBnHooks();
1035:
1036:            /**
1037:             * Set the Hooks of the project
1038:             * @ejb:interface-method view-type="both"
1039:             * @param pHooks the Hooks of the project
1040:             * @ejb:transaction type="Required"
1041:             **/
1042:            public abstract void setBnHooks(Collection pHooks);
1043:
1044:            /**
1045:             * @return  the Interactives Hooks of the project
1046:             * @ejb:interface-method view-type="both"
1047:             * @ejb:relation name="projectinterhook" role-name="is-hook-of"
1048:             *
1049:             * @ejb.value-object
1050:             *       match="normal"
1051:             *       type="Collection"
1052:             *       relation="external"
1053:             *       compose="hero.interfaces.BnProjectInterHookValue"
1054:             *       compose-name="BnInterHook"
1055:             *       members="hero.interfaces.BnProjectInterHookLocal"
1056:             *       members-name="BnInterHook"
1057:             * @ejb:transaction type="Supports"
1058:             *
1059:             * @jboss.relation-table create-table="true" remove-table="false"
1060:             *
1061:             **/
1062:            public abstract Collection getBnInterHooks();
1063:
1064:            /**
1065:             * Set the Interactives Hooks of the project
1066:             * @ejb:interface-method view-type="both"
1067:             * @param pHooks the Hooks of the project
1068:             * @ejb:transaction type="Required"
1069:             **/
1070:            public abstract void setBnInterHooks(Collection pHooks);
1071:
1072:            /**
1073:             * @ejb.interface-method
1074:             * @ejb:transaction type="Supports"
1075:             */
1076:            public abstract BnProjectValue getBnProjectValue();
1077:
1078:            /**
1079:             * @returns the light value of the bean (without relationships)
1080:             * @ejb.interface-method view-type=both
1081:             */
1082:            public abstract BnProjectLightValue getBnProjectLightValue();
1083:
1084:            /**
1085:             * @ejb.interface-method
1086:             * @ejb:transaction type="Supports"
1087:             */
1088:            public abstract void setBnProjectValue(BnProjectValue v);
1089:
1090:            /**
1091:             *
1092:             * @ejb.select
1093:             *	  result-type-mapping="Local"
1094:             *     query="SELECT DISTINCT u.name FROM BnProject AS p, IN (p.bnUsers) as u
1095:             *				Where p.type = ?3"
1096:             *     transaction-type="Supports"
1097:             *
1098:             */
1099:            public abstract Collection ejbSelectModelUserList(String userName,
1100:                    String roleName, String type) throws FinderException;
1101:
1102:            /**
1103:             * @ejb.home-method view-type="local"
1104:             * @param projectName name of the project
1105:             * @param userName name of the user
1106:             * @ejb:transaction type="Supports"
1107:             *
1108:             **/
1109:            public Collection ejbHomeGetModelUserList(String userName,
1110:                    String roleName, String type) throws HeroException {
1111:                try {
1112:                    return (ejbSelectModelUserList(userName, roleName, type));
1113:                } catch (FinderException fe) {
1114:                    throw new HeroException(fe.getMessage());
1115:                }
1116:            }
1117:
1118:            /**
1119:             *
1120:             * @ejb.select
1121:             *	  result-type-mapping="Local"
1122:             *     query="SELECT DISTINCT p.creator FROM BnProject AS p
1123:             * 				Where p.type = ?3"
1124:             *     transaction-type="Supports"
1125:             *
1126:             */
1127:            public abstract Collection ejbSelectModelCreatorList(
1128:                    String userName, String roleName, String type)
1129:                    throws FinderException;
1130:
1131:            /**
1132:             * @ejb.home-method view-type="local"
1133:             * @param projectName name of the project
1134:             * @param userName name of the user
1135:             * @ejb:transaction type="Supports"
1136:             *
1137:             **/
1138:            public Collection ejbHomeGetModelCreatorList(String userName,
1139:                    String roleName, String type) throws HeroException {
1140:                try {
1141:                    return (ejbSelectModelCreatorList(userName, roleName, type));
1142:                } catch (FinderException fe) {
1143:                    throw new HeroException(fe.getMessage());
1144:                }
1145:            }
1146:
1147:            /**
1148:             *
1149:             * @ejb.select
1150:             *	  result-type-mapping="Local"
1151:             *     query="SELECT DISTINCT pr.name FROM BnProject AS p, IN (p.bnRoles) as pr
1152:             *				Where p.type = ?3"
1153:             *     transaction-type="Supports"
1154:             *
1155:             */
1156:            public abstract Collection ejbSelectModelRoleList(String userName,
1157:                    String roleName, String type) throws FinderException;
1158:
1159:            /**
1160:             * @ejb.home-method view-type="local"
1161:             * @param projectName name of the project
1162:             * @param userName name of the user
1163:             * @ejb:transaction type="Supports"
1164:             *
1165:             **/
1166:            public Collection ejbHomeGetModelRoleList(String userName,
1167:                    String roleName, String type) throws HeroException {
1168:                try {
1169:                    return (ejbSelectModelRoleList(userName, roleName, type));
1170:                } catch (FinderException fe) {
1171:                    throw new HeroException(fe.getMessage());
1172:                }
1173:            }
1174:
1175:            /**
1176:             *
1177:             * @ejb.select
1178:             *	  result-type-mapping="Local"
1179:             *     query="SELECT DISTINCT pp.theKey FROM BnProject AS p, in (p.bnProperties) as pp
1180:             *				Where p.type = ?3"
1181:             *     transaction-type="Supports"
1182:             *
1183:             */
1184:            public abstract Collection ejbSelectModelPropertyKeyList(
1185:                    String userName, String roleName, String type)
1186:                    throws FinderException;
1187:
1188:            /**
1189:             * @ejb.home-method view-type="local"
1190:             * @param projectName name of the project
1191:             * @param userName name of the user
1192:             * @ejb:transaction type="Supports"
1193:             *
1194:             **/
1195:            public Collection ejbHomeGetModelPropertyKeyList(String userName,
1196:                    String roleName, String type) throws HeroException {
1197:                try {
1198:                    return (ejbSelectModelPropertyKeyList(userName, roleName,
1199:                            type));
1200:                } catch (FinderException fe) {
1201:                    throw new HeroException(fe.getMessage());
1202:                }
1203:            }
1204:
1205:            /**
1206:             *
1207:             * @ejb.select
1208:             *	  result-type-mapping="Local"
1209:             *     query="SELECT DISTINCT p.state FROM BnProject AS p
1210:             *				Where p.type = ?3"
1211:             *     transaction-type="Supports"
1212:             *
1213:             */
1214:            public abstract Collection ejbSelectModelStateList(String userName,
1215:                    String roleName, String type) throws FinderException;
1216:
1217:            /**
1218:             * @ejb.home-method view-type="local"
1219:             * @param projectName name of the project
1220:             * @param userName name of the user
1221:             * @ejb:transaction type="Supports"
1222:             *
1223:             **/
1224:            public Collection ejbHomeGetModelStateList(String userName,
1225:                    String roleName, String type) throws HeroException {
1226:                try {
1227:                    return (ejbSelectModelStateList(userName, roleName, type));
1228:                } catch (FinderException fe) {
1229:                    throw new HeroException(fe.getMessage());
1230:                }
1231:            }
1232:
1233:            /**
1234:             *
1235:             * @ejb.select
1236:             *	  result-type-mapping="Local"
1237:             *     query="SELECT DISTINCT n.name FROM BnNode AS n, IN (n.bnProject.bnUsers) AS u, IN (u.bnRoles) AS r
1238:             *                              WHERE n.bnProject.name LIKE ?1
1239:             * 				                AND (n.state = 1 OR n.state = 3)
1240:             * 							    AND u.name = ?2
1241:             *                              AND r.id = n.bnRole.id
1242:             *                              AND (n.activityPerformer IS NULL OR n.activityPerformer = ?2)"
1243:             *     transaction-type="Supports"
1244:             *
1245:             */
1246:            public abstract Collection ejbSelectUserModelReady(
1247:                    String projectName, String userName) throws FinderException;
1248:
1249:            /**
1250:             * @ejb.select
1251:             *	  result-type-mapping="Local"
1252:             *     query="SELECT DISTINCT n.name FROM BnNode AS n
1253:             *                              WHERE n.bnProject.name LIKE ?1
1254:             *                              AND n.executor = ?2
1255:             *                              AND n.state = 10"
1256:             *     transaction-type="Supports"
1257:             *     */
1258:            public abstract Collection ejbSelectUserModelTerminated(
1259:                    String projectName, String userName) throws FinderException;
1260:
1261:            /**
1262:             *
1263:             * @ejb.select
1264:             *	  result-type-mapping="Local"
1265:             *     query="SELECT DISTINCT p.name FROM BnProject AS p
1266:             *                             WHERE p.type = 'Instance'
1267:             * 							   AND p.creator = ?1
1268:             * 				               AND (p.state = 0 OR p.state=1)"
1269:             *     transaction-type="Supports"
1270:             *
1271:             */
1272:            public abstract Collection ejbSelectUserInstancesProject(
1273:                    String userName) throws FinderException;
1274:
1275:            /**
1276:             * @ejb.home-method view-type="local"
1277:             * @param userName name of the user
1278:             * @ejb:transaction type="Supports"
1279:             *
1280:             **/
1281:            public Collection ejbHomeGetUserInstancesProject(String userName)
1282:                    throws HeroException {
1283:                try {
1284:                    return (ejbSelectUserInstancesProject(userName));
1285:                } catch (FinderException fe) {
1286:                    throw new HeroException(fe.getMessage());
1287:                }
1288:            }
1289:
1290:            /**
1291:             *
1292:             * @ejb.select
1293:             *	  result-type-mapping="Local"
1294:             *     query="SELECT DISTINCT p.version FROM BnProject AS p
1295:             *                             WHERE p.type = 'Instance'
1296:             * 							   AND p.creator = ?1
1297:             * 				               AND (p.state = 0 OR p.state=1)
1298:             * 							   AND p.name = ?2"
1299:             *     transaction-type="Supports"
1300:             *
1301:             */
1302:            public abstract String ejbSelectUserModelVersion(String userName,
1303:                    String project) throws FinderException;
1304:
1305:            /**
1306:             * @ejb.home-method view-type="local"
1307:             * @param userName name of the user
1308:             * @ejb:transaction type="Supports"
1309:             *
1310:             **/
1311:            public String ejbHomeGetUserModelVersion(String userName,
1312:                    String project) throws HeroException {
1313:                try {
1314:                    return (ejbSelectUserModelVersion(userName, project));
1315:                } catch (FinderException fe) {
1316:                    throw new HeroException(fe.getMessage());
1317:                }
1318:            }
1319:
1320:            /**
1321:             * @ejb.home-method view-type="local"
1322:             * @param projectName name of the project
1323:             * @param userName name of the user
1324:             * @ejb:transaction type="Supports"
1325:             *
1326:             **/
1327:            public Collection ejbHomeGetUserModelReady(String projectName,
1328:                    String userName) throws HeroException {
1329:                try {
1330:                    return (ejbSelectUserModelReady(projectName, userName));
1331:                } catch (FinderException fe) {
1332:                    throw new HeroException(fe.getMessage());
1333:                }
1334:            }
1335:
1336:            /**
1337:             * @ejb.home-method view-type="local"
1338:             * @param projectName name of the project
1339:             * @param userName name of the user
1340:             * @ejb:transaction type="Supports"
1341:             *
1342:             **/
1343:            public Collection ejbHomeGetUserModelTerminated(String projectName,
1344:                    String userName) throws HeroException {
1345:                try {
1346:                    return (ejbSelectUserModelTerminated(projectName, userName));
1347:                } catch (FinderException fe) {
1348:                    throw new HeroException(fe.getMessage());
1349:                }
1350:            }
1351:
1352:            // -------------------------------------------------------------------------
1353:            // Framework Callbacks
1354:            // -------------------------------------------------------------------------
1355:
1356:            /**
1357:             * Create a BnProject
1358:             *
1359:             * @throws InvalidValueException If one of the values are not correct,
1360:             *                               this will not roll back the transaction
1361:             *                               because the caller has the chance to
1362:             *                               fix the problem and try again
1363:             * @throws EJBException If no new unique ID could be retrieved this will
1364:             *                      rollback the transaction because there is no
1365:             *                      hope to try again
1366:             * @throws CreateException Because we have to do so (EJB spec.)
1367:             *
1368:             * @ejb:create-method view-type="both"
1369:             * @ejb:transaction type="Required"
1370:             **/
1371:            public BnProjectPK ejbCreate() throws InvalidValueException,
1372:                    EJBException, CreateException {
1373:                // Each title must have a unique id to identify itself within the DB
1374:                this .setId(hero.interfaces.BnProjectUtil.generateGUID(this ));
1375:
1376:                // This is only possible in CMPs. Otherwise return a valid PK.
1377:                return null;
1378:            }
1379:
1380:            /**
1381:             * Create a BnProject based on project name and creator.
1382:             *
1383:             * @param pName the name of the project
1384:             * @param pCreator the creator of the project
1385:             *
1386:             * @throws EJBException If no new unique ID could be retrieved this will
1387:             *                      rollback the transaction because there is no
1388:             *                      hope to try again
1389:             * @throws CreateException Because we have to do so (EJB spec.)
1390:             *
1391:             * @ejb:create-method view-type="both"
1392:             * @ejb:transaction type="Required"
1393:             **/
1394:            public BnProjectPK ejbCreate(String pName, String pVersion,
1395:                    String creator) throws InvalidValueException, EJBException,
1396:                    CreateException {
1397:                log.debug("ejbCreate: pName=" + pName + " creator=" + creator);
1398:                try {
1399:                    SequenceGeneratorLocalHome sgHome = SequenceGeneratorUtil
1400:                            .getLocalHome();
1401:                    SequenceGeneratorLocal sg = sgHome.create();
1402:
1403:                    this .setId(new Integer(sg.getNextNumber("BnProject"))
1404:                            .toString());
1405:
1406:                    if (pName.matches(".*_instance.*"))
1407:                        this .setName(pName + this .getId());
1408:                    else
1409:                        this .setName(pName);
1410:                    this .setCreator(creator);
1411:                    this .setVersion(pVersion);
1412:
1413:                } catch (NamingException ne) {
1414:                    throw new CreateException("Naming lookup failure: "
1415:                            + ne.getMessage());
1416:                } catch (HeroException re) {
1417:                    throw new CreateException(re.getMessage());
1418:                }
1419:
1420:                // This is only possible in CMPs. Otherwise return a valid PK.
1421:                return null;
1422:            }
1423:
1424:            public void setEntityContext(EntityContext lContext) {
1425:                mContext = lContext;
1426:            }
1427:
1428:            public void unsetEntityContext() {
1429:                mContext = null;
1430:            }
1431:
1432:            public void ejbActivate() {
1433:            }
1434:
1435:            public void ejbPassivate() {
1436:            }
1437:
1438:            public void ejbLoad() {
1439:            }
1440:
1441:            public void ejbStore() {
1442:            }
1443:
1444:            public void ejbRemove() throws RemoveException {
1445:            }
1446:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.