KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jcorporate > expresso > core > db > config > JDBCConfig


1 /* ====================================================================
2 * The Jcorporate Apache Style Software License, Version 1.2 05-07-2002
3 *
4 * Copyright (c) 1995-2002 Jcorporate Ltd. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
16 * distribution.
17 *
18 * 3. The end-user documentation included with the redistribution,
19 * if any, must include the following acknowledgment:
20 * "This product includes software developed by Jcorporate Ltd.
21 * (http://www.jcorporate.com/)."
22 * Alternately, this acknowledgment may appear in the software itself,
23 * if and wherever such third-party acknowledgments normally appear.
24 *
25 * 4. "Jcorporate" and product names such as "Expresso" must
26 * not be used to endorse or promote products derived from this
27 * software without prior written permission. For written permission,
28 * please contact info@jcorporate.com.
29 *
30 * 5. Products derived from this software may not be called "Expresso",
31 * or other Jcorporate product names; nor may "Expresso" or other
32 * Jcorporate product names appear in their name, without prior
33 * written permission of Jcorporate Ltd.
34 *
35 * 6. No product derived from this software may compete in the same
36 * market space, i.e. framework, without prior written permission
37 * of Jcorporate Ltd. For written permission, please contact
38 * partners@jcorporate.com.
39 *
40 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
41 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
42 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
43 * DISCLAIMED. IN NO EVENT SHALL JCORPORATE LTD OR ITS CONTRIBUTORS
44 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
45 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
46 * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
47 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
48 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
49 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
50 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 * ====================================================================
53 *
54 * This software consists of voluntary contributions made by many
55 * individuals on behalf of the Jcorporate Ltd. Contributions back
56 * to the project(s) are encouraged when you make modifications.
57 * Please send them to support@jcorporate.com. For more information
58 * on Jcorporate Ltd. and its products, please see
59 * <http://www.jcorporate.com/>.
60 *
61 * Portions of this software are based upon other open source
62 * products and are subject to their respective licenses.
63  */

64
65 package com.jcorporate.expresso.core.db.config;
66
67 import com.jcorporate.expresso.core.db.DefaultEscapeHandler;
68 import com.jcorporate.expresso.core.db.EscapeHandler;
69 import com.jcorporate.expresso.core.misc.StringUtil;
70 import com.jcorporate.expresso.core.misc.SystemMacros;
71 import com.jcorporate.expresso.kernel.util.ClassLocator;
72
73 import java.util.Vector JavaDoc;
74
75 /**
76  * A Commons digester class for JDBC section of the standardmaessig
77  * Expresso Configuration XML file. This bean defines the conection characteristics
78  * to the database in this context
79  * <p/>
80  * <p>Documentation written by Peter Pilgrim @ Xenonsoft, Tue Feb 05 22:55:00 GMT 2002</p>
81  * <p/>
82  * All the 'bean' methods here are directly mapped to the &lt;jdbc&gt; section
83  * int the expresso-config.xml file. It is recommend that you also look at the
84  * Expresso config DTD for a better understanding of the relation of these various
85  * parameters.
86  *
87  * @author Michael Nash, Yves AMAIZO, Peter Pilgrim, Michael Rimov
88  * @since Expresso 5.1, its predecessor in the core.misc package since Expresso 4.0
89  */

90 public class JDBCConfig {
91
92     public JDBCConfig() {
93     }
94
95     protected String JavaDoc driverType = null;
96     protected String JavaDoc driver = null;
97     protected String JavaDoc url = null;
98     protected String JavaDoc connectFormat = null;
99     protected String JavaDoc login = null;
100     protected String JavaDoc password = null;
101     protected String JavaDoc cache = null;
102     protected Vector JavaDoc wildCards = new Vector JavaDoc();
103     protected String JavaDoc dateSelectFormat = null;
104     protected String JavaDoc dateSelectFunction = null;
105     protected String JavaDoc dateUpdateFormat = null;
106     protected String JavaDoc dateUpdateFunction = null;
107     protected String JavaDoc timeSelectFormat = null;
108     protected String JavaDoc timeSelectFunction = null;
109     protected String JavaDoc timeUpdateFormat = null;
110     protected String JavaDoc timeUpdateFunction = null;
111     protected String JavaDoc dateTimeSelectFormat = null;
112     protected String JavaDoc dateTimeSelectFunction = null;
113     protected String JavaDoc dateTimeUpdateFormat = null;
114     protected String JavaDoc dateTimeUpdateFunction = null;
115     protected String JavaDoc dbStats = "y";
116     protected String JavaDoc dbTest = null;
117     protected String JavaDoc createTableIndicies = null;
118     protected String JavaDoc limitationSyntax = null;
119     protected String JavaDoc limitationPosition = null;
120     protected String JavaDoc uniqueRowKeyword = null;
121     protected String JavaDoc skipText = "n";
122     protected String JavaDoc useNullOnCreate = "n";
123     protected String JavaDoc nativeBool = "y";
124     protected String JavaDoc transactionNotActive = "n";
125     protected String JavaDoc stringNotTrim = "n";
126     protected String JavaDoc checkZeroUpdate = null;
127     protected String JavaDoc escapeHandler =
128             com.jcorporate.expresso.core.db.DefaultEscapeHandler.class.getName();
129
130     protected EscapeHandler escapeHandlerInstance = null;
131
132     protected String JavaDoc nativeBlob = "n";
133     protected String JavaDoc dbSchema = null;
134     protected String JavaDoc dbCatalogue = null;
135
136
137     private java.util.List JavaDoc typeMappings = null;
138
139     /**
140      * Sets the skip text flag
141      *
142      * @param newSkip new Skip boolean value in sstring form
143      */

144     public void setSkipText(String JavaDoc newSkip) {
145         StringUtil.assertBoolean(newSkip, "You must specify a boolean value");
146         skipText = newSkip;
147     }
148
149     /**
150      * Set the flag that specifies if we use the "null" keyword in the
151      * create table statement when setting a field which does allow
152      * nulls. Some databases insist on this (sybase),
153      * others do not allow it (firebird)
154      *
155      * @param newUseNull checks if we should use the null keyword in dealing
156      * with table creation.
157      */

158     public void setUseNullOnCreate(String JavaDoc newUseNull) {
159         StringUtil.assertBoolean(newUseNull,
160                 "You must specify a boolean value");
161         useNullOnCreate = newUseNull;
162     }
163
164     /**
165      * Get the flag that specifies if we use the "null" keyword in the
166      * create table statement when setting a field which does allow
167      * nulls. Some databases insist on this (sybase),
168      * others do not allow it (firebird)
169      *
170      * @return boolean
171      */

172     public boolean useNullOnCreate() {
173         return StringUtil.toBoolean(useNullOnCreate);
174     }
175
176     /**
177      * Gets the skip text flag
178      *
179      * @return boolean
180      */

181     public boolean skipText() {
182         return StringUtil.toBoolean(skipText);
183     }
184
185     /**
186      * Sets the unique keyword flag
187      *
188      * @param newKey the new string to use for 'unique row' as a keyword for
189      * your database
190      */

191     public void setUniqueRowKeyword(String JavaDoc newKey) {
192         uniqueRowKeyword = newKey;
193     }
194
195     /**
196      * Gets the unique keyword flag
197      *
198      * @return java.lang.String
199      */

200     public String JavaDoc getUniqueRowKeyword() {
201         return uniqueRowKeyword;
202     }
203
204     /**
205      * Sets the limitation syntax string
206      *
207      * @param newLimit the limitation syntax string
208      */

209     public void setLimitationSyntax(String JavaDoc newLimit) {
210         limitationSyntax = newLimit;
211     }
212
213     /**
214      * Gets the limitation syntax
215      *
216      * @return java.lang.String
217      */

218     public String JavaDoc getLimitationSyntax() {
219         return limitationSyntax;
220     }
221
222     /**
223      * Sets the limitation position string
224      *
225      * @param newPos The limitation syntax position string. See the DTD for
226      * possible values
227      */

228     public void setLimitationPosition(String JavaDoc newPos) {
229         limitationPosition = newPos;
230     }
231
232     /**
233      * Gets the limitation syntax position string
234      *
235      * @return java.lang.String
236      */

237     public String JavaDoc getLimitationPosition() {
238         return limitationPosition;
239     }
240
241     /**
242      * Sets the database test
243      *
244      * @param newTest java.lang.String
245      */

246     public void setDbTest(String JavaDoc newTest) {
247         dbTest = newTest;
248     }
249
250     /**
251      * Retrieves the DB test string
252      *
253      * @return java.lang.String
254      */

255     public String JavaDoc getDbTest() {
256         return dbTest;
257     }
258
259     /**
260      * Sets the database statistics flag boolean
261      *
262      * @param newStats true if you wish to get Database stats
263      */

264     public void setDbStats(String JavaDoc newStats) {
265         StringUtil.assertBoolean(newStats, "You must specify a boolean value");
266         dbStats = newStats;
267     }
268
269     /**
270      * Gets the database statistics flag boolean
271      *
272      * @return boolean
273      */

274     public boolean dbStats() {
275         return StringUtil.toBoolean(dbStats);
276     }
277
278     /**
279      * Sets the create table indicies boolean value
280      *
281      * @param newIndicies boolean string indicating that database CREATE INDEX statements
282      * should be issued to the underlying database on db creation.
283      */

284     public void setCreateTableIndicies(String JavaDoc newIndicies) {
285         StringUtil.assertBoolean(newIndicies,
286                 "createTableIndicies must be y, n, true, false, yes, or no");
287         createTableIndicies = newIndicies;
288     }
289
290     /**
291      * Gets the create table indicies boolean value
292      *
293      * @return true if DBCreate should issue CREATE INDEX Statements
294      */

295     public boolean createTableIndicies() {
296         return StringUtil.toBoolean(createTableIndicies);
297     }
298
299     /**
300      * Sets the date select format string
301      *
302      * @param newFormat The data select format string.
303      */

304     public void setDateSelectFormat(String JavaDoc newFormat) {
305         dateSelectFormat = newFormat;
306     }
307
308     /**
309      * Sets the time select format string
310      *
311      * @param newFormat the new time select format string
312      */

313     public void setTimeSelectFormat(String JavaDoc newFormat) {
314         timeSelectFormat = newFormat;
315     }
316
317     /**
318      * Sets the date time select format string
319      *
320      * @param newFormat the Date-Time Select format formatting string
321      */

322     public void setDateTimeSelectFormat(String JavaDoc newFormat) {
323         dateTimeSelectFormat = newFormat;
324     }
325
326     /**
327      * Sets the date update format string
328      *
329      * @param newFormat the new Date Update format to use
330      */

331     public void setDateUpdateFormat(String JavaDoc newFormat) {
332         dateUpdateFormat = newFormat;
333     }
334
335     /**
336      * Sets the time update format string
337      *
338      * @param newFormat the new TimeUpdate format
339      */

340     public void setTimeUpdateFormat(String JavaDoc newFormat) {
341         timeUpdateFormat = newFormat;
342     }
343
344     /**
345      * Sets the date time update format string
346      *
347      * @param newFormat the new date time format string for update statements
348      */

349     public void setDateTimeUpdateFormat(String JavaDoc newFormat) {
350         dateTimeUpdateFormat = newFormat;
351     }
352
353     /**
354      * Sets the date select functon string
355      *
356      * @param newFunction the new format string to use for selecting date types
357      * from the database
358      */

359     public void setDateSelectFunction(String JavaDoc newFunction) {
360         dateSelectFunction = newFunction;
361     }
362
363     /**
364      * Sets the time select function string
365      *
366      * @param newFunction the new function for formatting time strings for
367      * database select statements
368      */

369     public void setTimeSelectFunction(String JavaDoc newFunction) {
370         timeSelectFunction = newFunction;
371     }
372
373     /**
374      * Sets the date time select function string
375      *
376      * @param newFunction the new function for date time select statements
377      */

378     public void setDateTimeSelectFunction(String JavaDoc newFunction) {
379         dateTimeSelectFunction = newFunction;
380     }
381
382     /**
383      * Sets the date update function string
384      *
385      * @param newFunction the new date update function for UPDATE execution
386      * statements
387      */

388     public void setDateUpdateFunction(String JavaDoc newFunction) {
389         dateUpdateFunction = newFunction;
390     }
391
392     /**
393      * Sets the time update function string
394      *
395      * @param newFunction the new Time Update function to execute for TIME
396      * datatypes for UPDATE execution statements.
397      */

398     public void setTimeUpdateFunction(String JavaDoc newFunction) {
399         timeUpdateFunction = newFunction;
400     }
401
402     /**
403      * Sets the date time update function string
404      *
405      * @param newFunction the new date-type update funciton
406      */

407     public void setDateTimeUpdateFunction(String JavaDoc newFunction) {
408         dateTimeUpdateFunction = newFunction;
409     }
410
411     /**
412      * Gets the date update function string
413      *
414      * @return java.lang.String
415      */

416     public String JavaDoc getDateSelectFormat() {
417         return dateSelectFormat;
418     }
419
420     // Gets *PP*
421
/**
422      * Gets the date select format string
423      *
424      * @return java.lang.String
425      */

426     public String JavaDoc getDateSelectFunction() {
427         return dateSelectFunction;
428     }
429
430     /**
431      * Gets the date update format string
432      *
433      * @return java.lang.String
434      */

435     public String JavaDoc getDateUpdateFormat() {
436         return dateUpdateFormat;
437     }
438
439     /**
440      * Gets the date update function string
441      *
442      * @return java.lang.String
443      */

444     public String JavaDoc getDateUpdateFunction() {
445         return dateUpdateFunction;
446     }
447
448     /**
449      * Gets the time select function string
450      *
451      * @return java.lang.String
452      */

453     public String JavaDoc getTimeSelectFormat() {
454         return timeSelectFormat;
455     }
456
457     /**
458      * Gets the time select function string
459      *
460      * @return java.lang.String
461      */

462     public String JavaDoc getTimeSelectFunction() {
463         return timeSelectFunction;
464     }
465
466     /**
467      * Gets the time update format string
468      *
469      * @return java.lang.String
470      */

471     public String JavaDoc getTimeUpdateFormat() {
472         return timeUpdateFormat;
473     }
474
475     /**
476      * Gets the time update function string
477      *
478      * @return java.lang.String
479      */

480     public String JavaDoc getTimeUpdateFunction() {
481         return timeUpdateFunction;
482     }
483
484     /**
485      * Sets the date time select format string
486      *
487      * @return java.lang.String
488      */

489     public String JavaDoc getDateTimeSelectFormat() {
490         return dateTimeSelectFormat;
491     }
492
493     /**
494      * Sets the date time select function string
495      *
496      * @return java.lang.String
497      */

498     public String JavaDoc getDateTimeSelectFunction() {
499         return dateTimeSelectFunction;
500     }
501
502     /**
503      * Sets the date time update format string
504      *
505      * @return java.lang.String
506      */

507     public String JavaDoc getDateTimeUpdateFormat() {
508         return dateTimeUpdateFormat;
509     }
510
511     /**
512      * Sets the date time select function string
513      *
514      * @return java.lang.STring
515      */

516     public String JavaDoc getDateTimeUpdateFunction() {
517         return dateTimeUpdateFunction;
518     }
519
520     /**
521      * Sets the JDBC driver class name
522      *
523      * @param newDriver the new driver class name as spefied by the config file
524      */

525     public void setDriver(String JavaDoc newDriver) {
526         StringUtil.assertNotBlank(newDriver, "Driver name must be specified");
527         driver = newDriver.trim();
528     }
529
530     /**
531      * Adds the specified wildcard entry
532      *
533      * @param newWild a new string that denotes wildcard strings for this
534      * database
535      */

536     public void addWildcard(String JavaDoc newWild) {
537         wildCards.addElement(newWild);
538     }
539
540     /**
541      * Gets a vector list of wildcard entries
542      *
543      * @return java.util.Vector of wildcard strings
544      */

545     public Vector JavaDoc getWildcards() {
546         return wildCards;
547     }
548
549     /**
550      * Sets the JDBC driver Type name
551      *
552      * @param newDriverType either &quote;datasource&quote; or &quote;jdbc&quote;
553      */

554     public void setDriverType(String JavaDoc newDriverType) {
555         driverType = newDriverType.trim();
556     }
557
558     /**
559      * Gets the JDBC Driver Type name
560      *
561      * @return java.lang.String
562      */

563     public String JavaDoc getDriverType() {
564         return driverType;
565     }
566
567     /**
568      * Gets the JDBC Driver class name
569      *
570      * @return java.lang.String
571      */

572     public String JavaDoc getDriver() {
573         return driver;
574     }
575
576     /**
577      * Sets the JDBC URL
578      *
579      * @param newUrl the new URL for the JDBC connection
580      */

581     public void setUrl(String JavaDoc newUrl) {
582         url = newUrl;
583     }
584
585     /**
586      * Gets the JDBC URL
587      *
588      * @return java.lang.String
589      */

590     public String JavaDoc getUrl() {
591         return SystemMacros.getInstance().expandValue(url);
592     }
593
594     /**
595      * Sets the JDBC connection format style. How does Expresso
596      * connect to the data source?
597      *
598      * @param newFormat number one through 5
599      */

600     public void setConnectFormat(String JavaDoc newFormat) {
601         StringUtil.assertNotBlank(newFormat,
602                 "Connection format must be specified");
603         connectFormat = newFormat.trim();
604     }
605
606     /**
607      * Gets the JDBC connection format style.
608      * How does Expresso connect to the data source?
609      *
610      * @return java.lang.String
611      */

612     public String JavaDoc getConnectFormat() {
613         return connectFormat;
614     }
615
616     /**
617      * Sets the JDBC login account name
618      *
619      * @param newLogin the login to use for JDBC
620      */

621     public void setLogin(String JavaDoc newLogin) {
622         login = newLogin;
623     }
624
625     /**
626      * Gets the JDBC login account name
627      *
628      * @return getLogin
629      */

630     public String JavaDoc getLogin() {
631         return login;
632     }
633
634     /**
635      * Sets whether or not this JDBC configuration supports a native boolean
636      * datatype.
637      *
638      * @param newValue true if your database supports native boolean data types.
639      */

640     public void setHasBooleanType(String JavaDoc newValue) {
641         StringUtil.assertBoolean(newValue,
642                 "You must specify a boolean value for nativeBool attribute");
643         this.nativeBool = newValue;
644     }
645
646
647     /**
648      * Sets whether the database supports the native BLOB datatype, or whether
649      * you need binary streams.
650      *
651      * @param newValue The new value to set.
652      */

653     public void setNativeBlob(String JavaDoc newValue) {
654         StringUtil.assertBoolean(newValue,
655                 "You must specify a boolean value for nativeBool attribute");
656         this.nativeBlob = newValue;
657     }
658
659     /**
660      * Return whether this database type supports native blob types
661      *
662      * @return boolean true if it supports native blob types.
663      */

664     public boolean isNativeBlob() {
665         return StringUtil.toBoolean(this.nativeBlob);
666     }
667
668     /**
669      * Sets the escape handler for this jdbc connection. ie. What class performs
670      * the filtering on the codes to properly process any special characters
671      * for the database.
672      *
673      * @param newValue The new value to set for the escape handler. Must be a valid
674      * classname in your class path.
675      */

676     public void setEscapeHandler(String JavaDoc newValue) {
677
678         try {
679
680             Class JavaDoc clazz = ClassLocator.loadClass(newValue);
681             escapeHandlerInstance = (EscapeHandler) clazz.newInstance();
682         } catch (InstantiationException JavaDoc ex) {
683             escapeHandlerInstance = new DefaultEscapeHandler();
684             throw new IllegalArgumentException JavaDoc("Unable to instantiate database escape handler: " +
685                     newValue +
686                     " please check your expresso-config.xml file");
687         } catch (IllegalAccessException JavaDoc ex) {
688             escapeHandlerInstance = new DefaultEscapeHandler();
689             throw new IllegalArgumentException JavaDoc("Unable to construct database escape handler: " +
690                     newValue +
691                     " it does not have a default constructor");
692         } catch (ClassNotFoundException JavaDoc ex) {
693             escapeHandlerInstance = new DefaultEscapeHandler();
694             throw new IllegalArgumentException JavaDoc("Unable to load database escape handler: " +
695                     newValue +
696                     " please check your expresso-config.xml file");
697         }
698         escapeHandler = newValue;
699
700     }
701
702     /**
703      * Get the classname of the current escape handler for this data context
704      *
705      * @return Classname as java.lang.String
706      */

707     public String JavaDoc getEscapeHandler() {
708         return escapeHandler;
709     }
710
711     public EscapeHandler getEscapeHandlerClass() {
712         return this.escapeHandlerInstance;
713     }
714
715     /**
716      * Returns whether or not this database supports native boolean datatypes
717      *
718      * @return true if the database supports boolean datatypes natively
719      */

720     public boolean isNativeBool() {
721         return StringUtil.toBoolean(this.nativeBool);
722     }
723
724     /**
725      * Sets the JDBC login password
726      *
727      * @param newPassword the new password to connect to the database
728      */

729     public void setPassword(String JavaDoc newPassword) {
730         password = newPassword;
731     }
732
733     /**
734      * Gets the JDBC login password
735      *
736      * @return java.lang.String
737      */

738     public String JavaDoc getPassword() {
739         return password;
740     }
741
742     /**
743      * Sets the cache enabled boolean flag
744      *
745      * @param newCache true if you want this data context cached
746      */

747     public void setCache(String JavaDoc newCache) {
748         StringUtil.assertBoolean(newCache, "You must specify a boolean value");
749         cache = newCache;
750     }
751
752     /**
753      * Gets the cache enabled boolean flag
754      *
755      * @return true if this data context is true
756      */

757     public boolean cache() {
758         return StringUtil.toBoolean(cache);
759     }
760
761     /**
762      * Set the check zero update version
763      *
764      * @param newCheckZeroUpdate - a boolean value
765      */

766     public void setCheckZeroUpdate(String JavaDoc newCheckZeroUpdate) {
767         StringUtil.assertBoolean(newCheckZeroUpdate,
768                 "You must specify a boolean value for checkZeroUpdate");
769         checkZeroUpdate = newCheckZeroUpdate;
770         System.out.println("ConfigJDBC.setCheckZeroUpdate() newValue:" +
771                 newCheckZeroUpdate);
772     }
773
774     /**
775      * Gets the check zero update version as a boolean
776      *
777      * @return java.lang.String
778      */

779     public String JavaDoc getCheckZeroUpdate() {
780         return checkZeroUpdate;
781     }
782
783     /**
784      * Gets the check zero update version as a boolean
785      *
786      * @return true if you are supposed to check for zero update
787      */

788     public boolean checkZeroUpdate() {
789         return StringUtil.toBoolean(checkZeroUpdate);
790     }
791
792     /**
793      * Retrieve a list of all type mappings available.
794      *
795      * @return java.util.List a list of TypeMappingConfig objects
796      * @since Expresso 5.1
797      */

798     public java.util.List JavaDoc getTypeMappings() {
799         return typeMappings;
800     }
801
802     /**
803      * Old type mappings style for a Vector to help with migration. Will
804      * eventually be deprecated.
805      *
806      * @return java.util.Vector of type mapping objects.
807      */

808     public java.util.Vector JavaDoc getTypeMappingVector() {
809         return new Vector JavaDoc(typeMappings);
810     }
811
812     /**
813      * Set the list of type mappings
814      *
815      * @param newValue a list of TypeMappingConfig objects
816      * @since Expresso 5.1
817      */

818     public void setTypeMappings(java.util.List JavaDoc newValue) {
819         this.typeMappings = newValue;
820     }
821
822     /**
823      * Add a type mapping to the system
824      *
825      * @param newValue a new TypeMappingConfig value.
826      */

827     public void addTypeMapping(TypeMappingConfig newValue) {
828         if (typeMappings == null) {
829             typeMappings = new java.util.ArrayList JavaDoc(10);
830         }
831
832         typeMappings.add(newValue);
833     }
834
835     /**
836      * Get the NoTrim parameter setting
837      *
838      * @return java.lang.String
839      */

840     public String JavaDoc getStringNotTrim() {
841         return stringNotTrim;
842     }
843
844     /**
845      * Get the transaction non action setting
846      *
847      * @return java.lang.String
848      */

849     public String JavaDoc getTransactionNotActive() {
850         return transactionNotActive;
851     }
852
853     /**
854      * Set the NoTrim parameter setting
855      *
856      * @param string
857      */

858     public void setStringNotTrim(String JavaDoc newValue) {
859         StringUtil.assertBoolean(newValue,
860                 "You must specify a boolean value for stringNoTrim attribute");
861         this.stringNotTrim = newValue;
862     }
863
864     /**
865      * Set the transaction non action parameter
866      * <p/>
867      * * @param string
868      */

869     public void setTransactionNotActive(String JavaDoc newValue) {
870         StringUtil.assertBoolean(newValue,
871                 "You must specify a boolean value for transactionNotActive attribute");
872         transactionNotActive = newValue;
873     }
874
875     /**
876      * Return whether this database persistence string will not be trimmed before store it
877      * and get it after.
878      * <p/>
879      * * @return boolean true if database string column will not be trimmed before or after store or get.
880      */

881     public boolean isStringNotTrim() {
882         return StringUtil.toBoolean(this.stringNotTrim);
883     }
884
885     /**
886      * Return whether this database transaction is active or not
887      *
888      * @return boolean true if database transactive will not activate.
889      */

890     public boolean isTransactionNotActive() {
891         return StringUtil.toBoolean(this.transactionNotActive);
892     }
893
894
895     /**
896      * @return
897      */

898     public String JavaDoc getDbCatalogue() {
899         return dbCatalogue;
900     }
901
902     /**
903      * @return
904      */

905     public String JavaDoc getDbSchema() {
906         return dbSchema;
907     }
908
909     /**
910      * @param string
911      */

912     public void setDbCatalogue(String JavaDoc newValue) {
913         this.dbCatalogue = newValue;
914     }
915
916     /**
917      * @param string
918      */

919     public void setDbSchema(String JavaDoc newValue) {
920         this.dbSchema = newValue;
921     }
922
923 }
924
Popular Tags