Source Code Cross Referenced for ValidFieldValue.java in  » J2EE » Jaffa » org » jaffa » rules » examples » domain » 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 » Jaffa » org.jaffa.rules.examples.domain 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        // .//GEN-BEGIN:1_be
002:        /******************************************************
003:         * Code Generated From JAFFA Framework Default Pattern
004:         * 
005:         * The JAFFA Project can be found at http://jaffa.sourceforge.net
006:         * and is available under the Lesser GNU Public License
007:         ******************************************************/package org.jaffa.rules.examples.domain;
008:
009:        import org.apache.log4j.Logger;
010:        import java.util.*;
011:        import org.jaffa.datatypes.*;
012:        import org.jaffa.metadata.*;
013:        import org.jaffa.rules.RulesEngine;
014:        import org.jaffa.persistence.*;
015:        import org.jaffa.persistence.exceptions.*;
016:        import org.jaffa.exceptions.FrameworkException;
017:        import org.jaffa.exceptions.RelatedDomainObjectFoundException;
018:        import org.jaffa.exceptions.DuplicateKeyException;
019:        import org.jaffa.datatypes.exceptions.InvalidForeignKeyException;
020:        import org.jaffa.exceptions.ApplicationExceptions;
021:
022:        // .//GEN-END:1_be
023:        // Add additional imports//GEN-FIRST:imports
024:
025:        // .//GEN-LAST:imports
026:        // .//GEN-BEGIN:2_be
027:        /**
028:         * Auto Generated Persistent class for the VALID_FIELD_VALUE table.
029:         * @author  Auto-Generated
030:         */
031:        public class ValidFieldValue extends Persistent {
032:
033:            private static final Logger log = Logger
034:                    .getLogger(ValidFieldValue.class);
035:
036:            /** Holds value of property tableName. */
037:            private java.lang.String m_tableName;
038:
039:            /** Holds value of property fieldName. */
040:            private java.lang.String m_fieldName;
041:
042:            /** Holds value of property legalValue. */
043:            private java.lang.String m_legalValue;
044:
045:            /** Holds value of property description. */
046:            private java.lang.String m_description;
047:
048:            /** Holds value of property remarks. */
049:            private java.lang.String m_remarks;
050:
051:            /** Check if the domain object exists for the input Primary Key.
052:             * @return true if the domain object exists for the input Primary Key.
053:             * @throws FrameworkException Indicates some system error
054:             */
055:            public static boolean exists(UOW uow, java.lang.String tableName,
056:                    java.lang.String fieldName, java.lang.String legalValue)
057:                    throws FrameworkException {
058:                return findByPK(uow, tableName, fieldName, legalValue) != null ? true
059:                        : false;
060:            }
061:
062:            /** Returns the domain object for the input Primary Key.
063:             * @return the domain object for the input Primary Key. A null is returned if the domain object is not found.
064:             * @throws FrameworkException Indicates some system error
065:             */
066:            public static ValidFieldValue findByPK(UOW uow,
067:                    java.lang.String tableName, java.lang.String fieldName,
068:                    java.lang.String legalValue) throws FrameworkException {
069:                boolean localUow = false;
070:                try {
071:                    if (uow == null || !uow.isActive()) {
072:                        uow = new UOW();
073:                        localUow = true;
074:                    }
075:                    Criteria criteria = findByPKCriteria(tableName, fieldName,
076:                            legalValue);
077:                    Iterator itr = uow.query(criteria).iterator();
078:                    if (itr.hasNext())
079:                        return (ValidFieldValue) itr.next();
080:                    else
081:                        return null;
082:                } finally {
083:                    if (localUow && uow != null)
084:                        uow.rollback();
085:                }
086:            }
087:
088:            /** Returns a Criteria object for retrieving the domain object based on the input Primary Key.
089:             * @return a Criteria object for retrieving the domain object based on the input Primary Key.
090:             */
091:            public static Criteria findByPKCriteria(java.lang.String tableName,
092:                    java.lang.String fieldName, java.lang.String legalValue) {
093:                Criteria criteria = new Criteria();
094:                criteria.setTable(ValidFieldValueMeta.getName());
095:                criteria.addCriteria(ValidFieldValueMeta.TABLE_NAME, tableName);
096:                criteria.addCriteria(ValidFieldValueMeta.FIELD_NAME, fieldName);
097:                criteria.addCriteria(ValidFieldValueMeta.LEGAL_VALUE,
098:                        legalValue);
099:                return criteria;
100:            }
101:
102:            // .//GEN-END:2_be
103:            // .//GEN-BEGIN:tableName_be
104:            /** Getter for property tableName.
105:             * @return Value of property tableName.
106:             */
107:            public java.lang.String getTableName() {
108:                return m_tableName;
109:            }
110:
111:            /** Use this method to update the property tableName.
112:             * This method will do nothing and simply return if the input value is the same as the current value.
113:             * Validation will be performed on the input value.
114:             * This will try to lock the underlying database row, in case CAUTIOUS locking is specified at the time of query.
115:             * @param tableName New value of property tableName.
116:             * @throws ValidationException if an invalid value is passed.
117:             * @throws UpdatePrimaryKeyException if this domain object was loaded from the database.
118:             * @throws ReadOnlyObjectException if a Read-Only object is updated.
119:             * @throws AlreadyLockedObjectException if the underlying database row is already locked by another process.
120:             * @throws FrameworkException Indicates some system error
121:             */
122:            public void setTableName(java.lang.String tableName)
123:                    throws ValidationException, UpdatePrimaryKeyException,
124:                    ReadOnlyObjectException, AlreadyLockedObjectException,
125:                    FrameworkException {
126:                // ignore, if the current value and new value are the same
127:                if (m_tableName == null ? tableName == null : m_tableName
128:                        .equals(tableName))
129:                    return;
130:
131:                // this is part of the primary key.. do not update if its a database occurence.
132:                if (isDatabaseOccurence())
133:                    throw new UpdatePrimaryKeyException();
134:
135:                tableName = validateTableName(tableName);
136:                // .//GEN-END:tableName_be
137:                // Add custom code before setting the value//GEN-FIRST:tableName
138:
139:                // .//GEN-LAST:tableName
140:                // .//GEN-BEGIN:tableName_1_be
141:                super .update();
142:                super .addInitialValue(ValidFieldValueMeta.TABLE_NAME,
143:                        m_tableName);
144:                m_tableName = tableName;
145:                // .//GEN-END:tableName_1_be
146:                // Add custom code after setting the value//GEN-FIRST:tableName_3
147:
148:                // .//GEN-LAST:tableName_3
149:                // .//GEN-BEGIN:tableName_2_be
150:            }
151:
152:            /** This method is present for backwards compatibility only.
153:             * It merely invokes the setTableName() method.
154:             * @param tableName New value of property tableName.
155:             * @throws ValidationException if an invalid value is passed.
156:             * @throws UpdatePrimaryKeyException if this domain object was loaded from the database.
157:             * @throws ReadOnlyObjectException if a Read-Only object is updated.
158:             * @throws AlreadyLockedObjectException if the underlying database row is already locked by another process.
159:             * @throws FrameworkException Indicates some system error
160:             */
161:            public void updateTableName(java.lang.String tableName)
162:                    throws ValidationException, UpdatePrimaryKeyException,
163:                    ReadOnlyObjectException, AlreadyLockedObjectException,
164:                    FrameworkException {
165:                setTableName(tableName);
166:            }
167:
168:            /** Use this method to validate a value for the property tableName.
169:             * @param tableName Value to be validated for the property tableName.
170:             * @throws ValidationException if an invalid value is passed
171:             * @throws FrameworkException Indicates some system error
172:             */
173:            public java.lang.String validateTableName(java.lang.String tableName)
174:                    throws ValidationException, FrameworkException {
175:                // .//GEN-END:tableName_2_be
176:                // Add custom code before validation//GEN-FIRST:tableName_1
177:
178:                // .//GEN-LAST:tableName_1
179:                // .//GEN-BEGIN:tableName_3_be
180:                tableName = FieldValidator
181:                        .validate(
182:                                tableName,
183:                                (StringFieldMetaData) ValidFieldValueMeta.META_TABLE_NAME,
184:                                true);
185:
186:                // Invoke the Dynamic Rules Engine
187:                RulesEngine.doAllValidationsForDomainField(ValidFieldValueMeta
188:                        .getName(), ValidFieldValueMeta.TABLE_NAME, tableName,
189:                        this .getUOW());
190:
191:                // .//GEN-END:tableName_3_be
192:                // Add custom code after a successful validation//GEN-FIRST:tableName_2
193:
194:                // .//GEN-LAST:tableName_2
195:                // .//GEN-BEGIN:tableName_4_be
196:                return tableName;
197:            }
198:
199:            // .//GEN-END:tableName_4_be
200:            // .//GEN-BEGIN:fieldName_be
201:            /** Getter for property fieldName.
202:             * @return Value of property fieldName.
203:             */
204:            public java.lang.String getFieldName() {
205:                return m_fieldName;
206:            }
207:
208:            /** Use this method to update the property fieldName.
209:             * This method will do nothing and simply return if the input value is the same as the current value.
210:             * Validation will be performed on the input value.
211:             * This will try to lock the underlying database row, in case CAUTIOUS locking is specified at the time of query.
212:             * @param fieldName New value of property fieldName.
213:             * @throws ValidationException if an invalid value is passed.
214:             * @throws UpdatePrimaryKeyException if this domain object was loaded from the database.
215:             * @throws ReadOnlyObjectException if a Read-Only object is updated.
216:             * @throws AlreadyLockedObjectException if the underlying database row is already locked by another process.
217:             * @throws FrameworkException Indicates some system error
218:             */
219:            public void setFieldName(java.lang.String fieldName)
220:                    throws ValidationException, UpdatePrimaryKeyException,
221:                    ReadOnlyObjectException, AlreadyLockedObjectException,
222:                    FrameworkException {
223:                // ignore, if the current value and new value are the same
224:                if (m_fieldName == null ? fieldName == null : m_fieldName
225:                        .equals(fieldName))
226:                    return;
227:
228:                // this is part of the primary key.. do not update if its a database occurence.
229:                if (isDatabaseOccurence())
230:                    throw new UpdatePrimaryKeyException();
231:
232:                fieldName = validateFieldName(fieldName);
233:                // .//GEN-END:fieldName_be
234:                // Add custom code before setting the value//GEN-FIRST:fieldName
235:
236:                // .//GEN-LAST:fieldName
237:                // .//GEN-BEGIN:fieldName_1_be
238:                super .update();
239:                super .addInitialValue(ValidFieldValueMeta.FIELD_NAME,
240:                        m_fieldName);
241:                m_fieldName = fieldName;
242:                // .//GEN-END:fieldName_1_be
243:                // Add custom code after setting the value//GEN-FIRST:fieldName_3
244:
245:                // .//GEN-LAST:fieldName_3
246:                // .//GEN-BEGIN:fieldName_2_be
247:            }
248:
249:            /** This method is present for backwards compatibility only.
250:             * It merely invokes the setFieldName() method.
251:             * @param fieldName New value of property fieldName.
252:             * @throws ValidationException if an invalid value is passed.
253:             * @throws UpdatePrimaryKeyException if this domain object was loaded from the database.
254:             * @throws ReadOnlyObjectException if a Read-Only object is updated.
255:             * @throws AlreadyLockedObjectException if the underlying database row is already locked by another process.
256:             * @throws FrameworkException Indicates some system error
257:             */
258:            public void updateFieldName(java.lang.String fieldName)
259:                    throws ValidationException, UpdatePrimaryKeyException,
260:                    ReadOnlyObjectException, AlreadyLockedObjectException,
261:                    FrameworkException {
262:                setFieldName(fieldName);
263:            }
264:
265:            /** Use this method to validate a value for the property fieldName.
266:             * @param fieldName Value to be validated for the property fieldName.
267:             * @throws ValidationException if an invalid value is passed
268:             * @throws FrameworkException Indicates some system error
269:             */
270:            public java.lang.String validateFieldName(java.lang.String fieldName)
271:                    throws ValidationException, FrameworkException {
272:                // .//GEN-END:fieldName_2_be
273:                // Add custom code before validation//GEN-FIRST:fieldName_1
274:
275:                // .//GEN-LAST:fieldName_1
276:                // .//GEN-BEGIN:fieldName_3_be
277:                fieldName = FieldValidator
278:                        .validate(
279:                                fieldName,
280:                                (StringFieldMetaData) ValidFieldValueMeta.META_FIELD_NAME,
281:                                true);
282:
283:                // Invoke the Dynamic Rules Engine
284:                RulesEngine.doAllValidationsForDomainField(ValidFieldValueMeta
285:                        .getName(), ValidFieldValueMeta.FIELD_NAME, fieldName,
286:                        this .getUOW());
287:
288:                // .//GEN-END:fieldName_3_be
289:                // Add custom code after a successful validation//GEN-FIRST:fieldName_2
290:
291:                // .//GEN-LAST:fieldName_2
292:                // .//GEN-BEGIN:fieldName_4_be
293:                return fieldName;
294:            }
295:
296:            // .//GEN-END:fieldName_4_be
297:            // .//GEN-BEGIN:legalValue_be
298:            /** Getter for property legalValue.
299:             * @return Value of property legalValue.
300:             */
301:            public java.lang.String getLegalValue() {
302:                return m_legalValue;
303:            }
304:
305:            /** Use this method to update the property legalValue.
306:             * This method will do nothing and simply return if the input value is the same as the current value.
307:             * Validation will be performed on the input value.
308:             * This will try to lock the underlying database row, in case CAUTIOUS locking is specified at the time of query.
309:             * @param legalValue New value of property legalValue.
310:             * @throws ValidationException if an invalid value is passed.
311:             * @throws UpdatePrimaryKeyException if this domain object was loaded from the database.
312:             * @throws ReadOnlyObjectException if a Read-Only object is updated.
313:             * @throws AlreadyLockedObjectException if the underlying database row is already locked by another process.
314:             * @throws FrameworkException Indicates some system error
315:             */
316:            public void setLegalValue(java.lang.String legalValue)
317:                    throws ValidationException, UpdatePrimaryKeyException,
318:                    ReadOnlyObjectException, AlreadyLockedObjectException,
319:                    FrameworkException {
320:                // ignore, if the current value and new value are the same
321:                if (m_legalValue == null ? legalValue == null : m_legalValue
322:                        .equals(legalValue))
323:                    return;
324:
325:                // this is part of the primary key.. do not update if its a database occurence.
326:                if (isDatabaseOccurence())
327:                    throw new UpdatePrimaryKeyException();
328:
329:                legalValue = validateLegalValue(legalValue);
330:                // .//GEN-END:legalValue_be
331:                // Add custom code before setting the value//GEN-FIRST:legalValue
332:
333:                // .//GEN-LAST:legalValue
334:                // .//GEN-BEGIN:legalValue_1_be
335:                super .update();
336:                super .addInitialValue(ValidFieldValueMeta.LEGAL_VALUE,
337:                        m_legalValue);
338:                m_legalValue = legalValue;
339:                // .//GEN-END:legalValue_1_be
340:                // Add custom code after setting the value//GEN-FIRST:legalValue_3
341:
342:                // .//GEN-LAST:legalValue_3
343:                // .//GEN-BEGIN:legalValue_2_be
344:            }
345:
346:            /** This method is present for backwards compatibility only.
347:             * It merely invokes the setLegalValue() method.
348:             * @param legalValue New value of property legalValue.
349:             * @throws ValidationException if an invalid value is passed.
350:             * @throws UpdatePrimaryKeyException if this domain object was loaded from the database.
351:             * @throws ReadOnlyObjectException if a Read-Only object is updated.
352:             * @throws AlreadyLockedObjectException if the underlying database row is already locked by another process.
353:             * @throws FrameworkException Indicates some system error
354:             */
355:            public void updateLegalValue(java.lang.String legalValue)
356:                    throws ValidationException, UpdatePrimaryKeyException,
357:                    ReadOnlyObjectException, AlreadyLockedObjectException,
358:                    FrameworkException {
359:                setLegalValue(legalValue);
360:            }
361:
362:            /** Use this method to validate a value for the property legalValue.
363:             * @param legalValue Value to be validated for the property legalValue.
364:             * @throws ValidationException if an invalid value is passed
365:             * @throws FrameworkException Indicates some system error
366:             */
367:            public java.lang.String validateLegalValue(
368:                    java.lang.String legalValue) throws ValidationException,
369:                    FrameworkException {
370:                // .//GEN-END:legalValue_2_be
371:                // Add custom code before validation//GEN-FIRST:legalValue_1
372:
373:                // .//GEN-LAST:legalValue_1
374:                // .//GEN-BEGIN:legalValue_3_be
375:                legalValue = FieldValidator
376:                        .validate(
377:                                legalValue,
378:                                (StringFieldMetaData) ValidFieldValueMeta.META_LEGAL_VALUE,
379:                                true);
380:
381:                // Invoke the Dynamic Rules Engine
382:                RulesEngine.doAllValidationsForDomainField(ValidFieldValueMeta
383:                        .getName(), ValidFieldValueMeta.LEGAL_VALUE,
384:                        legalValue, this .getUOW());
385:
386:                // .//GEN-END:legalValue_3_be
387:                // Add custom code after a successful validation//GEN-FIRST:legalValue_2
388:
389:                // .//GEN-LAST:legalValue_2
390:                // .//GEN-BEGIN:legalValue_4_be
391:                return legalValue;
392:            }
393:
394:            // .//GEN-END:legalValue_4_be
395:            // .//GEN-BEGIN:description_be
396:            /** Getter for property description.
397:             * @return Value of property description.
398:             */
399:            public java.lang.String getDescription() {
400:                return m_description;
401:            }
402:
403:            /** Use this method to update the property description.
404:             * This method will do nothing and simply return if the input value is the same as the current value.
405:             * Validation will be performed on the input value.
406:             * This will try to lock the underlying database row, in case CAUTIOUS locking is specified at the time of query.
407:             * @param description New value of property description.
408:             * @throws ValidationException if an invalid value is passed.
409:             * @throws ReadOnlyObjectException if a Read-Only object is updated.
410:             * @throws AlreadyLockedObjectException if the underlying database row is already locked by another process.
411:             * @throws FrameworkException Indicates some system error
412:             */
413:            public void setDescription(java.lang.String description)
414:                    throws ValidationException, ReadOnlyObjectException,
415:                    AlreadyLockedObjectException, FrameworkException {
416:                // ignore, if the current value and new value are the same
417:                if (m_description == null ? description == null : m_description
418:                        .equals(description))
419:                    return;
420:
421:                description = validateDescription(description);
422:                // .//GEN-END:description_be
423:                // Add custom code before setting the value//GEN-FIRST:description
424:
425:                // .//GEN-LAST:description
426:                // .//GEN-BEGIN:description_1_be
427:                super .update();
428:                super .addInitialValue(ValidFieldValueMeta.DESCRIPTION,
429:                        m_description);
430:                m_description = description;
431:                // .//GEN-END:description_1_be
432:                // Add custom code after setting the value//GEN-FIRST:description_3
433:
434:                // .//GEN-LAST:description_3
435:                // .//GEN-BEGIN:description_2_be
436:            }
437:
438:            /** This method is present for backwards compatibility only.
439:             * It merely invokes the setDescription() method.
440:             * @param description New value of property description.
441:             * @throws ValidationException if an invalid value is passed.
442:             * @throws ReadOnlyObjectException if a Read-Only object is updated.
443:             * @throws AlreadyLockedObjectException if the underlying database row is already locked by another process.
444:             * @throws FrameworkException Indicates some system error
445:             */
446:            public void updateDescription(java.lang.String description)
447:                    throws ValidationException, ReadOnlyObjectException,
448:                    AlreadyLockedObjectException, FrameworkException {
449:                setDescription(description);
450:            }
451:
452:            /** Use this method to validate a value for the property description.
453:             * @param description Value to be validated for the property description.
454:             * @throws ValidationException if an invalid value is passed
455:             * @throws FrameworkException Indicates some system error
456:             */
457:            public java.lang.String validateDescription(
458:                    java.lang.String description) throws ValidationException,
459:                    FrameworkException {
460:                // .//GEN-END:description_2_be
461:                // Add custom code before validation//GEN-FIRST:description_1
462:
463:                // .//GEN-LAST:description_1
464:                // .//GEN-BEGIN:description_3_be
465:                description = FieldValidator
466:                        .validate(
467:                                description,
468:                                (StringFieldMetaData) ValidFieldValueMeta.META_DESCRIPTION,
469:                                true);
470:
471:                // Invoke the Dynamic Rules Engine
472:                RulesEngine.doAllValidationsForDomainField(ValidFieldValueMeta
473:                        .getName(), ValidFieldValueMeta.DESCRIPTION,
474:                        description, this .getUOW());
475:
476:                // .//GEN-END:description_3_be
477:                // Add custom code after a successful validation//GEN-FIRST:description_2
478:
479:                // .//GEN-LAST:description_2
480:                // .//GEN-BEGIN:description_4_be
481:                return description;
482:            }
483:
484:            // .//GEN-END:description_4_be
485:            // .//GEN-BEGIN:remarks_be
486:            /** Getter for property remarks.
487:             * @return Value of property remarks.
488:             */
489:            public java.lang.String getRemarks() {
490:                return m_remarks;
491:            }
492:
493:            /** Use this method to update the property remarks.
494:             * This method will do nothing and simply return if the input value is the same as the current value.
495:             * Validation will be performed on the input value.
496:             * This will try to lock the underlying database row, in case CAUTIOUS locking is specified at the time of query.
497:             * @param remarks New value of property remarks.
498:             * @throws ValidationException if an invalid value is passed.
499:             * @throws ReadOnlyObjectException if a Read-Only object is updated.
500:             * @throws AlreadyLockedObjectException if the underlying database row is already locked by another process.
501:             * @throws FrameworkException Indicates some system error
502:             */
503:            public void setRemarks(java.lang.String remarks)
504:                    throws ValidationException, ReadOnlyObjectException,
505:                    AlreadyLockedObjectException, FrameworkException {
506:                // ignore, if the current value and new value are the same
507:                if (m_remarks == null ? remarks == null : m_remarks
508:                        .equals(remarks))
509:                    return;
510:
511:                remarks = validateRemarks(remarks);
512:                // .//GEN-END:remarks_be
513:                // Add custom code before setting the value//GEN-FIRST:remarks
514:
515:                // .//GEN-LAST:remarks
516:                // .//GEN-BEGIN:remarks_1_be
517:                super .update();
518:                super .addInitialValue(ValidFieldValueMeta.REMARKS, m_remarks);
519:                m_remarks = remarks;
520:                // .//GEN-END:remarks_1_be
521:                // Add custom code after setting the value//GEN-FIRST:remarks_3
522:
523:                // .//GEN-LAST:remarks_3
524:                // .//GEN-BEGIN:remarks_2_be
525:            }
526:
527:            /** This method is present for backwards compatibility only.
528:             * It merely invokes the setRemarks() method.
529:             * @param remarks New value of property remarks.
530:             * @throws ValidationException if an invalid value is passed.
531:             * @throws ReadOnlyObjectException if a Read-Only object is updated.
532:             * @throws AlreadyLockedObjectException if the underlying database row is already locked by another process.
533:             * @throws FrameworkException Indicates some system error
534:             */
535:            public void updateRemarks(java.lang.String remarks)
536:                    throws ValidationException, ReadOnlyObjectException,
537:                    AlreadyLockedObjectException, FrameworkException {
538:                setRemarks(remarks);
539:            }
540:
541:            /** Use this method to validate a value for the property remarks.
542:             * @param remarks Value to be validated for the property remarks.
543:             * @throws ValidationException if an invalid value is passed
544:             * @throws FrameworkException Indicates some system error
545:             */
546:            public java.lang.String validateRemarks(java.lang.String remarks)
547:                    throws ValidationException, FrameworkException {
548:                // .//GEN-END:remarks_2_be
549:                // Add custom code before validation//GEN-FIRST:remarks_1
550:
551:                // .//GEN-LAST:remarks_1
552:                // .//GEN-BEGIN:remarks_3_be
553:                remarks = FieldValidator.validate(remarks,
554:                        (StringFieldMetaData) ValidFieldValueMeta.META_REMARKS,
555:                        true);
556:
557:                // Invoke the Dynamic Rules Engine
558:                RulesEngine.doAllValidationsForDomainField(ValidFieldValueMeta
559:                        .getName(), ValidFieldValueMeta.REMARKS, remarks, this 
560:                        .getUOW());
561:
562:                // .//GEN-END:remarks_3_be
563:                // Add custom code after a successful validation//GEN-FIRST:remarks_2
564:
565:                // .//GEN-LAST:remarks_2
566:                // .//GEN-BEGIN:remarks_4_be
567:                return remarks;
568:            }
569:
570:            // .//GEN-END:remarks_4_be
571:            // .//GEN-BEGIN:toString_1_be
572:            /** This returns the diagnostic information.
573:             * @return the diagnostic information.
574:             */
575:            public String toString() {
576:                StringBuffer buf = new StringBuffer();
577:                buf.append("<ValidFieldValue>");
578:                buf.append("<tableName>");
579:                if (m_tableName != null)
580:                    buf.append(m_tableName);
581:                buf.append("</tableName>");
582:                buf.append("<fieldName>");
583:                if (m_fieldName != null)
584:                    buf.append(m_fieldName);
585:                buf.append("</fieldName>");
586:                buf.append("<legalValue>");
587:                if (m_legalValue != null)
588:                    buf.append(m_legalValue);
589:                buf.append("</legalValue>");
590:                buf.append("<description>");
591:                if (m_description != null)
592:                    buf.append(m_description);
593:                buf.append("</description>");
594:                buf.append("<remarks>");
595:                if (m_remarks != null)
596:                    buf.append(m_remarks);
597:                buf.append("</remarks>");
598:                // .//GEN-END:toString_1_be
599:                // Add custom debug information//GEN-FIRST:toString_1
600:
601:                // .//GEN-LAST:toString_1
602:                // .//GEN-BEGIN:toString_2_be
603:                buf.append(super .toString());
604:                buf.append("</ValidFieldValue>");
605:                return buf.toString();
606:            }
607:
608:            // .//GEN-END:toString_2_be
609:            // .//GEN-BEGIN:clone_1_be
610:            /** Returns a clone of the object.
611:             * @throws CloneNotSupportedException if cloning is not supported. This should never happen.
612:             * @return a clone of the object.
613:             */
614:            public Object clone() throws CloneNotSupportedException {
615:                ValidFieldValue obj = (ValidFieldValue) super .clone();
616:                return obj;
617:            }
618:
619:            // .//GEN-END:clone_1_be
620:            // .//GEN-BEGIN:performForeignKeyValidations_1_be
621:            /** This method ensures that the modified foreign-keys are valid.
622:             * @throws ApplicationExceptions if an invalid foreign key is set.
623:             * @throws FrameworkException Indicates some system error
624:             */
625:            public void performForeignKeyValidations()
626:                    throws ApplicationExceptions, FrameworkException {
627:                ApplicationExceptions appExps = new ApplicationExceptions();
628:                if (appExps.size() > 0)
629:                    throw appExps;
630:            }
631:
632:            // .//GEN-END:performForeignKeyValidations_1_be
633:            // .//GEN-BEGIN:performPreDeleteReferentialIntegrity_1_be
634:            /** This method is triggered by the UOW, before adding this object to the Delete-Store.
635:             * This will raise an exception if any associated/aggregated objects exist.
636:             * This will cascade delete all composite objects.
637:             * @throws PreDeleteFailedException if any error occurs during the process.
638:             */
639:            public void performPreDeleteReferentialIntegrity()
640:                    throws PreDeleteFailedException {
641:            }
642:            // .//GEN-END:performPreDeleteReferentialIntegrity_1_be
643:            // All the custom code goes here//GEN-FIRST:custom
644:
645:            // .//GEN-LAST:custom
646:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.