Source Code Cross Referenced for CoinImpl.java in  » J2EE » Enhydra-Demos » net » sourceforge » ejosa » piggybank » business » 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 » Enhydra Demos » net.sourceforge.ejosa.piggybank.business.entity 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**
002:         * Title:        EJOSA - Enterprise Java Open Source Architecture
003:         *               My Piggy Bank Example
004:         * Description:  Business Object
005:         * Copyright:    Copyright (c) 2003 by B. Lofi Dewanto, T. Menzel
006:         * Company:      University of Muenster, HTWK Leipzig
007:         * @author  B. Lofi Dewanto, T. Menzel
008:         * @version 1.2
009:         */package net.sourceforge.ejosa.piggybank.business.entity;
010:
011:        //import java.util.*;
012:
013:        import net.sourceforge.ejosa.piggybank.business.*;
014:        import net.sourceforge.ejosa.piggybank.data.coin.*;
015:        import net.sourceforge.ejosa.piggybank.spec.business.*;
016:        import net.sourceforge.ejosa.piggybank.spec.*;
017:
018:        /**
019:         * The state/value object/data transfer object class.
020:         *
021:         * @author  B. Lofi Dewanto, T. Menzel
022:         * @version 1.2
023:         */
024:        public class CoinImpl implements  Coin {
025:            // Data object
026:            protected CoinDO myDO = null;
027:
028:            // Primary Key
029:            public String id;
030:
031:            // Object state
032:            public String date;
033:            public String amount;
034:            public String currency;
035:
036:            /**
037:             * Constructor.
038:             */
039:            public CoinImpl() throws CoinException {
040:                try {
041:                    this .myDO = CoinDO.createVirgin();
042:                } catch (Exception ex) {
043:                    System.out.println("Exception: " + ex);
044:                    //throw new CoinBusinessException("Exception in Coin():"+ ex.printStackTrace());
045:                }
046:            }
047:
048:            /**
049:             * Constructor.
050:             */
051:            public CoinImpl(CoinDO theCoin) throws CoinException {
052:                try {
053:                    this .myDO = theCoin;
054:                } catch (Exception ex) {
055:                    System.out.println("Exception: " + ex);
056:                    //throw new CoinException("Exception in Coin(CoinDO):"+ ex.printStackTrace());
057:                }
058:            }
059:
060:            /**
061:             * Constructor.
062:             */
063:            public CoinImpl(String id) throws CoinException {
064:                try {
065:                    this .id = id;
066:                } catch (Exception ex) {
067:                    System.out.println("Exception: " + ex);
068:                    //throw new CoinException("Exception in Coin(String):"+ ex.printStackTrace());
069:                }
070:            }
071:
072:            public String getHandle() throws CoinException {
073:                try {
074:                    return this .myDO.getHandle();
075:                } catch (Exception ex) {
076:                    System.out.println("Exception: " + ex);
077:                    //throw new CoinException("Exception in getHandle():"+ ex.printStackTrace());
078:                    return null;
079:                }
080:            }
081:
082:            /**
083:             * Gets the Id of the coin.
084:             *
085:             * @return    the Id of the coin.
086:             * @exception CoinException.
087:             */
088:            public String getId() throws CoinException {
089:                try {
090:                    id = myDO.getID();
091:                    return id;
092:                } catch (Exception ex) {
093:                    System.out.println("Exception: " + ex);
094:                    //throw new CoinException("Exception in getId():"+ ex.printStackTrace());
095:                    return null;
096:                }
097:            }
098:
099:            /**
100:             * Sets the Id of the coin.
101:             *
102:             * @param     the Id to be changed.
103:             * @exception CoinException.
104:             */
105:            public void setId(String id) throws CoinException {
106:                try {
107:                    this .id = id;
108:                    this .myDO.setID(id);
109:                } catch (Exception ex) {
110:                    System.out.println("Exception: " + ex);
111:                    //throw new CoinException("Exception in setId(String):"+ ex.printStackTrace());
112:                }
113:            }
114:
115:            /**
116:             * Gets the date of insertion.
117:             *
118:             * @return    the date of insertion.
119:             * @exception CoinException.
120:             */
121:            public String getDate() throws CoinException {
122:                try {
123:                    date = myDO.getDATE();
124:                    return date;
125:                } catch (Exception ex) {
126:                    System.out.println("Exception: " + ex);
127:                    //throw new CoinException("Exception in getDate():"+ ex.printStackTrace());
128:                    return null;
129:                }
130:            }
131:
132:            /**
133:             * Sets the date of insertion.
134:             *
135:             * @param     the date to be changed.
136:             * @exception CoinException.
137:             */
138:            public void setDate(String inputDate) throws CoinException {
139:                try {
140:                    date = inputDate;
141:                    this .myDO.setDATE(inputDate);
142:                } catch (Exception ex) {
143:                    System.out.println("Exception: " + ex);
144:                    //throw new CoinException("Exception in setDate(String):"+ ex.printStackTrace());
145:                }
146:            }
147:
148:            /**
149:             * Gets the amount of the coin.
150:             *
151:             * @return    the amount of the coin.
152:             * @exception CoinException.
153:             */
154:            public String getAmount() throws CoinException {
155:                try {
156:                    amount = myDO.getAMOUNT();
157:                    return amount;
158:                } catch (Exception ex) {
159:                    System.out.println("Exception: " + ex);
160:                    //throw new CoinException("Exception in getAmount():"+ ex.printStackTrace());
161:                    return null;
162:                }
163:            }
164:
165:            /**
166:             * Sets the amount of the coin.
167:             *
168:             * @param     the amount to be changed.
169:             * @exception CoinException.
170:             */
171:            public void setAmount(String amount) throws CoinException {
172:                try {
173:                    this .amount = amount;
174:                    this .myDO.setAMOUNT(amount);
175:                } catch (Exception ex) {
176:                    System.out.println("Exception: " + ex);
177:                    //throw new CoinException("Exception in setAmount(String):"+ ex.printStackTrace());
178:                }
179:            }
180:
181:            /**
182:             * Gets the currency of the coin.
183:             *
184:             * @return    the currency of the coin.
185:             * @exception CoinException.
186:             */
187:            public String getCurrency() throws CoinException {
188:                try {
189:                    currency = myDO.getCURENCY();
190:                    return currency;
191:                } catch (Exception ex) {
192:                    System.out.println("Exception: " + ex);
193:                    //throw new CoinException("Exception in getCurrency():"+ ex.printStackTrace());
194:                    return null;
195:                }
196:            }
197:
198:            /**
199:             * Sets the currency of the coin.
200:             *
201:             * @param     the currency to be changed.
202:             * @exception CoinException.
203:             */
204:            public void setCurrency(String currency) throws CoinException {
205:                try {
206:                    this .currency = currency;
207:                    this .myDO.setCURENCY(currency);
208:                } catch (Exception ex) {
209:                    System.out.println("Exception: " + ex);
210:                    //throw new CoinException("Exception in setCurrency(String):"+ ex.printStackTrace());
211:                }
212:            }
213:
214:            /**
215:             * Commits all changes to the database.
216:             *
217:             * @exception CoinException if an error occurs
218:             *   retrieving data (usually due to an underlying data layer
219:             *   error).
220:             */
221:            public void save() throws CoinException {
222:                try {
223:                    this .myDO.commit();
224:                } catch (Exception ex) {
225:                    System.out.println("Exception: " + ex);
226:                    //throw new CoinException("Exception in save():"+ ex.printStackTrace());
227:                }
228:            }
229:
230:            /**
231:             * Deletes the disc from the database.
232:             *
233:             * @exception CoinException if an error occurs
234:             *   deleting data (usually due to an underlying data layer
235:             *   error).
236:             */
237:            public void delete() throws CoinException {
238:                try {
239:                    this .myDO.delete();
240:                } catch (Exception ex) {
241:                    System.out.println("Exception: " + ex);
242:                    //throw new CoinException("Exception in delete():"+ ex.printStackTrace());
243:                }
244:            }
245:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.