Source Code Cross Referenced for OrderBean.java in  » J2EE » JOnAS-4.8.6 » olstore » 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 » J2EE » JOnAS 4.8.6 » olstore.entity 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Copyright (c) 2004 Red Hat, Inc. All rights reserved.
003:         *
004:         * This library is free software; you can redistribute it and/or
005:         * modify it under the terms of the GNU Lesser General Public
006:         * License as published by the Free Software Foundation; either
007:         * version 2.1 of the License, or any later version.
008:         *
009:         * This library is distributed in the hope that it will be useful,
010:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
011:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
012:         * Lesser General Public License for more details.
013:         *
014:         * You should have received a copy of the GNU Lesser General Public
015:         * License along with this library; if not, write to the Free Software
016:         * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
017:         * USA
018:         *
019:         * Component of: Red Hat Application Server
020:         * 
021:         * Initial Developers: Aizaz Ahmed
022:         *                     Vivek Lakshmanan
023:         *                     Andrew Overholt
024:         *                     Matthew Wringe
025:         *
026:         */package olstore.entity;
027:
028:        import javax.ejb.EntityBean;
029:
030:        import olstore.entity.ItemLocal;
031:        import olstore.entity.UserLocal;
032:
033:        import java.math.BigDecimal;
034:
035:        /**
036:         * @ejb.bean name="Order"
037:         *  description="This bean is used to store information about an order."
038:         *	type="CMP"
039:         *  schema="olstore_order"
040:         *  primkey-field="orderId"
041:         *  reentrant="false"
042:         *  cmp-version="2.x"
043:         *  view-type="local"
044:         *  local-jndi-name="OrderLocal_L"
045:         * 
046:         * @ejb.transaction
047:         *  type="Required"
048:         * 
049:         *--
050:         * This is needed for JOnAS.
051:         * If you are not using JOnAS you can safely remove the tags below.
052:         * @jonas.bean ejb-name="Order"
053:         * jndi-name="OrderLocal"
054:         * @jonas.jdbc-mapping  jndi-name="jdbc_1" jdbc-table-name="olstore_order"
055:         *  automatic-pk="true" 
056:         * --
057:         * 
058:         *  @ejb.persistence
059:         * 
060:         * @ejb.finder 
061:         *    query="SELECT OBJECT(a) FROM olstore_order as a"  
062:         *    signature="java.util.Collection findAll()"  
063:         * 
064:         * @ejb.finder 
065:         *    query="SELECT OBJECT(a) FROM olstore_order as a WHERE NOT (a.status = ?1)"  
066:         *    signature="java.util.Collection findByStatus(java.lang.String status)"
067:         * 
068:         * @ejb.finder 
069:         *    query="SELECT OBJECT(a) FROM olstore_order as a WHERE a.orderId = ?1"  
070:         *    signature="olstore.entity.Order findByPrimaryKey(java.lang.Integer orderId)"
071:         * 
072:         *--
073:         * This is needed for JOnAS.
074:         * If you are not using JOnAS you can safely remove the tags below.
075:         * @jonas.finder-method-jdbc-mapping  method-name="findAll"
076:         *	jdbc-where-clause=""
077:         * @jonas.jdbc-mapping  jndi-name="jdbc_1"
078:         *	jdbc-table-name="olstore_order"
079:         * 
080:         *--
081:         *  
082:         **/
083:
084:        public abstract class OrderBean implements  EntityBean {
085:
086:            /**
087:             * The  ejbCreate method.
088:             * 
089:             * @ejb.create-method 
090:             */
091:            public java.lang.Integer ejbCreate(UserLocal user, ItemLocal item,
092:                    Integer quantity, String status, String dateReceived,
093:                    BigDecimal pricePaid) throws javax.ejb.CreateException {
094:                setQuantity(quantity);
095:                setStatus(status);
096:                setDateReceived(dateReceived);
097:                setPricePaid(pricePaid);
098:
099:                return null;
100:            }
101:
102:            /**
103:             * The container invokes this method immediately after it calls ejbCreate.
104:             * 
105:             */
106:            public void ejbPostCreate(UserLocal user, ItemLocal item,
107:                    Integer quantity, String status, String dateReceived,
108:                    BigDecimal pricePaid) throws javax.ejb.CreateException {
109:                setUser(user);
110:                setItem(item);
111:            }
112:
113:            /**
114:             * Returns the orderId
115:             * @return the orderId
116:             * 
117:             * @ejb.persistent-field 
118:             * @ejb.persistence
119:             *    column-name="orderId"
120:             *     sql-type="INTEGER"
121:             * @ejb.pk-field 
122:             * @ejb.interface-method
123:             * 
124:             */
125:            public abstract java.lang.Integer getOrderId();
126:
127:            /**
128:             * Sets the orderId
129:             * 
130:             * @param java.lang.Integer the new orderId value
131:             * 
132:             * @ejb.interface-method
133:             */
134:            public abstract void setOrderId(java.lang.Integer orderId);
135:
136:            /**
137:             * Returns the quantity
138:             * @return the quantity
139:             * 
140:             * @ejb.persistent-field 
141:             * @ejb.persistence
142:             *    column-name="quantity"
143:             *     sql-type="INTEGER"
144:             *  
145:             * @ejb.interface-method
146:             * 
147:             */
148:            public abstract java.lang.Integer getQuantity();
149:
150:            /**
151:             * Sets the quantity
152:             * 
153:             * @param java.lang.Integer the new quantity value
154:             * 
155:             * @ejb.interface-method
156:             */
157:            public abstract void setQuantity(java.lang.Integer quantity);
158:
159:            /**
160:             * Returns the status
161:             * @return the status
162:             * 
163:             * @ejb.persistent-field 
164:             * @ejb.persistence
165:             *    column-name="status"
166:             *     sql-type="VARCHAR"
167:             *  
168:             * @ejb.interface-method
169:             * 
170:             */
171:            public abstract java.lang.String getStatus();
172:
173:            /**
174:             * Sets the status
175:             * 
176:             * @param java.lang.String the new status value
177:             * 
178:             * @ejb.interface-method
179:             */
180:            public abstract void setStatus(java.lang.String status);
181:
182:            /**
183:             * Returns the dateReceived
184:             * @return the dateReceived
185:             * 
186:             * @ejb.persistent-field 
187:             * @ejb.persistence
188:             *    column-name="dateReceived"
189:             *     sql-type="VARCHAR"
190:             *  
191:             * @ejb.interface-method
192:             * 
193:             */
194:            public abstract java.lang.String getDateReceived();
195:
196:            /**
197:             * Sets the dateReceived
198:             * 
199:             * @param java.lang.String the new dateReceived value
200:             * 
201:             * @ejb.interface-method
202:             */
203:            public abstract void setDateReceived(java.lang.String dateReceived);
204:
205:            /**
206:             * Returns the pricePaid
207:             * @return the pricePaid
208:             * 
209:             * @ejb.persistent-field 
210:             * @ejb.persistence
211:             *    column-name="pricePaid"
212:             *     sql-type="NUMERIC"
213:             *  
214:             * @ejb.interface-method
215:             * 
216:             */
217:            public abstract BigDecimal getPricePaid();
218:
219:            /**
220:             * Sets the pricePaid
221:             * 
222:             * @param java.lang.Float the new pricePaid value
223:             * 
224:             * @ejb.interface-method
225:             */
226:            public abstract void setPricePaid(BigDecimal pricePaid);
227:
228:            /**
229:             * Returns the User for this Order
230:             * 
231:             * @return the User for this Order
232:             * 
233:             * @ejb.relation
234:             *  name="User-Order"
235:             *  role-name="Order-has-a-User"
236:             *  target-ejb="User"
237:             * @ejb.interface-method
238:             * 
239:             */
240:
241:            public abstract UserLocal getUser();
242:
243:            public abstract void setUser(UserLocal user);
244:
245:            /**
246:             * Returns the item for this Order
247:             * 
248:             * @return the item for this Order
249:             * 
250:             * @ejb.relation
251:             *  name="Order-Item"
252:             *  role-name="Order-has-many-Items"
253:             *  target-ejb="Item"
254:             *  target-multiple="yes"
255:             * 
256:             * @ejb.interface-method
257:             */
258:
259:            public abstract ItemLocal getItem();
260:
261:            public abstract void setItem(ItemLocal user);
262:
263:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.