Source Code Cross Referenced for Disc.java in  » J2EE » Enhydra-Demos » barracudaDiscRack » business » disc » 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 » barracudaDiscRack.business.disc 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Enhydra Java Application Server Project
003:         * 
004:         * The contents of this file are subject to the Enhydra Public License
005:         * Version 1.1 (the "License"); you may not use this file except in
006:         * compliance with the License. You may obtain a copy of the License on
007:         * the Enhydra web site ( http://www.enhydra.org/ ).
008:         * 
009:         * Software distributed under the License is distributed on an "AS IS"
010:         * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 
011:         * the License for the specific terms governing rights and limitations
012:         * under the License.
013:         * 
014:         * The Initial Developer of the Enhydra Application Server is Lutris
015:         * Technologies, Inc. The Enhydra Application Server and portions created
016:         * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
017:         * All Rights Reserved.
018:         * 
019:         * Contributor(s):
020:         * 
021:         * $Id: Disc.java,v 1.1 2006-09-11 12:30:36 sinisa Exp $
022:         */
023:
024:        package barracudaDiscRack.business.disc;
025:
026:        import barracudaDiscRack.business.DiscRackBusinessException;
027:        import barracudaDiscRack.business.person.Person;
028:        import barracudaDiscRack.data.person.PersonDO;
029:        import barracudaDiscRack.data.disc.DiscDO;
030:        import com.lutris.appserver.server.sql.DatabaseManagerException;
031:        import com.lutris.appserver.server.sql.ObjectIdException;
032:        import com.lutris.dods.builder.generator.query.DataObjectException;
033:
034:        /**
035:         * Represents a disc. 
036:         */
037:        public class Disc {
038:            /**
039:             * The DO of the disc.
040:             */
041:            protected DiscDO myDO = null;
042:
043:            /**
044:             * The public constructor.
045:             */
046:            public Disc() throws DiscRackBusinessException {
047:                try {
048:                    this .myDO = DiscDO.createVirgin();
049:                } catch (DatabaseManagerException ex) {
050:                    throw new DiscRackBusinessException(
051:                            "Error creating empty Disc", ex);
052:                } catch (ObjectIdException ex) {
053:                    throw new DiscRackBusinessException(
054:                            "Error creating empty Disc", ex);
055:                }
056:            }
057:
058:            /** The protected constructor
059:             *
060:             * @param theDisc. The data object of the disc.
061:             */
062:            protected Disc(DiscDO theDisc) throws DiscRackBusinessException {
063:                this .myDO = theDisc;
064:            }
065:
066:            /**
067:             * Gets the object id for the disc
068:             *
069:             * @return the object id.
070:             * @exception DiscRackBusinessException if an error occurs
071:             *   retrieving data (usually due to an underlying data layer
072:             *   error).
073:             */
074:            public String getHandle() throws DiscRackBusinessException {
075:                try {
076:                    return this .myDO.getHandle();
077:                } catch (DatabaseManagerException ex) {
078:                    throw new DiscRackBusinessException(
079:                            "Error getting disc's handle", ex);
080:                }
081:            }
082:
083:            /**
084:             * Gets the title for the disc
085:             *
086:             * @return the title.
087:             * @exception DiscRackBusinessException if an error occurs
088:             *   retrieving data (usually due to an underlying data layer
089:             *   error).
090:             */
091:            public String getTitle() throws DiscRackBusinessException {
092:                try {
093:                    return myDO.getTitle();
094:                } catch (DataObjectException ex) {
095:                    throw new DiscRackBusinessException(
096:                            "Error getting disc's title", ex);
097:                }
098:            }
099:
100:            /**
101:             * Gets the artist for the disc
102:             *
103:             * @return the artist.
104:             * @exception DiscRackBusinessException if an error occurs
105:             *   retrieving data (usually due to an underlying data layer
106:             *   error).
107:             */
108:            public String getArtist() throws DiscRackBusinessException {
109:                try {
110:                    return myDO.getArtist();
111:                } catch (DataObjectException ex) {
112:                    throw new DiscRackBusinessException(
113:                            "Error getting disc's artist", ex);
114:                }
115:            }
116:
117:            /**
118:             * Gets the genre for the disc
119:             *
120:             * @return the genre.
121:             * @exception DiscRackBusinessException if an error occurs
122:             *   retrieving data (usually due to an underlying data layer
123:             *   error).
124:             */
125:            public String getGenre() throws DiscRackBusinessException {
126:                try {
127:                    return myDO.getGenre();
128:                } catch (DataObjectException ex) {
129:                    throw new DiscRackBusinessException(
130:                            "Error getting disc's genre", ex);
131:                }
132:            }
133:
134:            /**
135:             * Gets the preference for the disc
136:             *
137:             * @return true if like the disc, false if not
138:             * @exception DiscRackBusinessException if an error occurs
139:             *   retrieving data (usually due to an underlying data layer
140:             *   error).
141:             */
142:            public boolean isLiked() throws DiscRackBusinessException {
143:                try {
144:                    return myDO.getIsLiked();
145:                } catch (DataObjectException ex) {
146:                    throw new DiscRackBusinessException(
147:                            "Error getting disc's likedness", ex);
148:                }
149:            }
150:
151:            /**
152:             * Sets the title for the disc.
153:             *
154:             * @param the title.
155:             * @exception DiscRackBusinessException if an error occurs
156:             *   setting the data (usually due to an underlying data layer
157:             *   error).
158:             */
159:            public void setTitle(String title) throws DiscRackBusinessException {
160:                try {
161:                    this .myDO.setTitle(title);
162:                } catch (DataObjectException ex) {
163:                    throw new DiscRackBusinessException(
164:                            "Error setting disc's title", ex);
165:                }
166:            }
167:
168:            /**
169:             * Sets the artist for the disc.
170:             *
171:             * @param the artist.
172:             * @exception DiscRackBusinessException if an error occurs
173:             *   setting the data (usually due to an underlying data layer
174:             *   error).
175:             */
176:            public void setArtist(String artist)
177:                    throws DiscRackBusinessException {
178:                try {
179:                    this .myDO.setArtist(artist);
180:                } catch (DataObjectException ex) {
181:                    throw new DiscRackBusinessException(
182:                            "Error setting disc's artist", ex);
183:                }
184:            }
185:
186:            /**
187:             * Sets the genre for the disc.
188:             *
189:             * @param the genre.
190:             * @exception DiscRackBusinessException if an error occurs
191:             *   setting the data (usually due to an underlying data layer
192:             *   error).
193:             */
194:            public void setGenre(String genre) throws DiscRackBusinessException {
195:                try {
196:                    this .myDO.setGenre(genre);
197:                } catch (DataObjectException ex) {
198:                    throw new DiscRackBusinessException(
199:                            "Error setting disc's genre", ex);
200:                }
201:            }
202:
203:            /**
204:             * Sets the owner for the disc.
205:             *
206:             * @param the owner.
207:             * @exception DiscRackBusinessException if an error occurs
208:             *   setting the data (usually due to an underlying data layer
209:             *   error).
210:             */
211:            public void setOwner(Person owner) throws DiscRackBusinessException {
212:                try {
213:                    this .myDO.setOwner(PersonDO.createExisting(owner
214:                            .getHandle()));
215:                } catch (DataObjectException ex) {
216:                    throw new DiscRackBusinessException(
217:                            "Error setting disc's owner", ex);
218:                }
219:            }
220:
221:            /**
222:             * Sets the preference for the disc.
223:             *
224:             * @param the preference.
225:             * @exception DiscRackBusinessException if an error occurs
226:             *   setting the data (usually due to an underlying data layer
227:             *   error).
228:             */
229:            public void setLiked(boolean isLiked)
230:                    throws DiscRackBusinessException {
231:                try {
232:                    this .myDO.setIsLiked(isLiked);
233:                } catch (DataObjectException ex) {
234:                    throw new DiscRackBusinessException(
235:                            "Error setting disc's likedness", ex);
236:                }
237:            }
238:
239:            /**
240:             * Commits all changes to the database.
241:             *
242:             * @exception DiscRackBusinessException if an error occurs
243:             *   retrieving data (usually due to an underlying data layer
244:             *   error).
245:             */
246:            public void save() throws DiscRackBusinessException {
247:                try {
248:                    this .myDO.commit();
249:                } catch (Exception ex) {
250:                    throw new DiscRackBusinessException("Error saving disc", ex);
251:                }
252:            }
253:
254:            /**
255:             * Deletes the disc from the database.
256:             *
257:             * @exception DiscRackBusinessException if an error occurs
258:             *   deleting data (usually due to an underlying data layer
259:             *   error).
260:             */
261:            public void delete() throws DiscRackBusinessException {
262:                try {
263:                    this .myDO.delete();
264:                } catch (Exception ex) {
265:                    throw new DiscRackBusinessException("Error deleting disc",
266:                            ex);
267:                }
268:            }
269:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.