Source Code Cross Referenced for DeleteProcedureDescriptor.java in  » Database-ORM » db-ojb » org » apache » ojb » broker » metadata » 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 » Database ORM » db ojb » org.apache.ojb.broker.metadata 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        package org.apache.ojb.broker.metadata;
002:
003:        /* Copyright 2003-2005 The Apache Software Foundation
004:         *
005:         * Licensed under the Apache License, Version 2.0 (the "License");
006:         * you may not use this file except in compliance with the License.
007:         * You may obtain a copy of the License at
008:         *
009:         *     http://www.apache.org/licenses/LICENSE-2.0
010:         *
011:         * Unless required by applicable law or agreed to in writing, software
012:         * distributed under the License is distributed on an "AS IS" BASIS,
013:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014:         * See the License for the specific language governing permissions and
015:         * limitations under the License.
016:         */
017:
018:        import org.apache.commons.lang.builder.ToStringBuilder;
019:        import org.apache.commons.lang.builder.ToStringStyle;
020:        import java.io.Serializable;
021:        import java.util.Iterator;
022:
023:        /**
024:         * An DeleteProcedureDescriptor contains information that is related to the
025:         * procedure/function that is used to handle the deleting of existing records.
026:         * <br>
027:         * Note: Be careful when use DeleteProcedureDescriptor variables or caching
028:         * DeleteProcedureDescriptor instances, because instances could become invalid
029:         * during runtime (see {@link MetadataManager}).
030:         *
031:         * @author <a href="mailto:rongallagher@bellsouth.net">Ron Gallagher<a>
032:         * @version $Id: DeleteProcedureDescriptor.java,v 1.7.2.3 2005/12/21 22:26:11 tomdz Exp $
033:         */
034:        public class DeleteProcedureDescriptor extends ProcedureDescriptor
035:                implements  Serializable, XmlCapable {
036:            private static final long serialVersionUID = -1265854095889157172L;
037:            //---------------------------------------------------------------
038:            /**
039:             * The value that indicates if the argument list for this procedure
040:             * includes only the field-descriptors from the related class-descriptor
041:             * that are identified as being part of the primary key.
042:             */
043:            private boolean includePkFieldsOnly;
044:
045:            //---------------------------------------------------------------
046:
047:            /**
048:             * Constructor declaration
049:             */
050:            public DeleteProcedureDescriptor(ClassDescriptor classDescriptor,
051:                    String name, boolean includePkFieldsOnly) {
052:                super (classDescriptor, name);
053:                if (includePkFieldsOnly) {
054:                    addArguments(getClassDescriptor().getPkFields());
055:                    addArguments(getClassDescriptor().getLockingFields());
056:                }
057:                this .includePkFieldsOnly = includePkFieldsOnly;
058:            }
059:
060:            //---------------------------------------------------------------
061:            /**
062:             * Retrieve the value that indicates if the argument list for this
063:             * procedure includes only the field-descriptors from the related
064:             * class-descriptor that are identified as being part of the primary
065:             * key.
066:             *
067:             * @return The current value
068:             */
069:            public boolean getIncludePkFieldsOnly() {
070:                return this .includePkFieldsOnly;
071:            }
072:
073:            //---------------------------------------------------------------
074:            /**
075:             * Add an argument
076:             * <p>
077:             * The argument will be added only if this procedure is not configured
078:             * to {@link #getIncludePkFieldsOnly() include just the
079:             * primary key fields}.
080:             */
081:            public final void addArgument(ArgumentDescriptor argument) {
082:                if (!this .getIncludePkFieldsOnly()) {
083:                    super .addArgument(argument);
084:                }
085:            }
086:
087:            /*
088:             * @see XmlCapable#toXML()
089:             */
090:            public String toXML() {
091:                RepositoryTags tags = RepositoryTags.getInstance();
092:                String eol = System.getProperty("line.separator");
093:
094:                // The result
095:                StringBuffer result = new StringBuffer(1024);
096:                result.append(eol);
097:                result.append("   ");
098:
099:                // Opening tag and attributes
100:                result.append(" ");
101:                result.append(tags
102:                        .getOpeningTagNonClosingById(DELETE_PROCEDURE));
103:                result.append(" ");
104:                result.append(tags.getAttribute(NAME, this .getName()));
105:                if (this .hasReturnValue()) {
106:                    result.append(" ");
107:                    result.append(tags.getAttribute(RETURN_FIELD_REF, this 
108:                            .getReturnValueFieldRefName()));
109:                }
110:                result.append(" ");
111:                result.append(tags.getAttribute(INCLUDE_PK_FIELDS_ONLY, String
112:                        .valueOf(this .getIncludePkFieldsOnly())));
113:                result.append(">");
114:                result.append(eol);
115:
116:                // Write all arguments only if we're not including all fields.
117:                if (!this .getIncludePkFieldsOnly()) {
118:                    Iterator args = this .getArguments().iterator();
119:                    while (args.hasNext()) {
120:                        result.append(((ArgumentDescriptor) args.next())
121:                                .toXML());
122:                    }
123:                }
124:
125:                // Closing tag
126:                result.append("    ");
127:                result.append(tags.getClosingTagById(DELETE_PROCEDURE));
128:                result.append(eol);
129:                return result.toString();
130:            }
131:
132:            //---------------------------------------------------------------
133:            /**
134:             * Provide a string representation of this object
135:             *
136:             * @return a string representation of this object
137:             */
138:            public String toString() {
139:                ToStringBuilder buf = new ToStringBuilder(this ,
140:                        ToStringStyle.MULTI_LINE_STYLE);
141:                buf.append("name", this .getName());
142:                buf
143:                        .append("includePkFieldsOnly", this 
144:                                .getIncludePkFieldsOnly());
145:                if (this .hasReturnValue()) {
146:                    buf.append("returnFieldRefName", this
147:                            .getReturnValueFieldRefName());
148:                }
149:                return buf.toString();
150:            }
151:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.