KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > mmbase > storage > implementation > database > Attributes


1 /*
2
3 This software is OSI Certified Open Source Software.
4 OSI Certified is a certification mark of the Open Source Initiative.
5
6 The license (Mozilla version 1.0) can be read at the MMBase site.
7 See http://www.MMBase.org/license
8
9 */

10 package org.mmbase.storage.implementation.database;
11
12 /**
13  * This class defines the attributes names used by the default database storage manager classes.
14  * Specific storage managers may ignore or add their own attributes.
15  *
16  * @author Pierre van Rooden
17  * @since MMBase-1.7
18  * @version $Id: Attributes.java,v 1.14 2005/02/03 09:21:38 michiel Exp $
19  */

20 public final class Attributes {
21
22     /**
23      * Attribute: <code>database-data-source</code>.
24      * The data source object used by the storage layer.
25      * This attribute is set by the storagelayer and returns a javax.sql.DataSource object.
26      * You should not set or configure this attribute (but you can retrieve it).
27      */

28     public static final String JavaDoc DATA_SOURCE = "database-data-source";
29
30     /**
31      * Option: <code>database-supports-transactions</code>.
32      * When true, the database supports transactions.
33      * The default is determined form the database, but you can override it.
34      */

35     public static final String JavaDoc SUPPORTS_TRANSACTIONS = "database-supports-transactions";
36
37     /**
38      * Option: <code>database-stores-binary-as-file</code>.
39      * When true, binary data is stored on disk, rather than in the database.
40      * If you set this option ou should also set the attribute {@link #BINARY_FILE_PATH}
41      * The default is <code>false</code>
42      */

43     public static final String JavaDoc STORES_BINARY_AS_FILE = "database-stores-binary-as-file";
44
45     /**
46      * Attribute: <code>database-binary-file-path</code>.
47      * The path to the directyory where binary files are to be stored if {@link #STORES_BINARY_AS_FILE} is true.
48      * The default is the WEB-INF/data directory of the mmbase web application.
49      * Note that if you specify a relative url, it is taken from the web application's webroot.
50      */

51     public static final String JavaDoc BINARY_FILE_PATH = "database-binary-file-path";
52
53     /**
54      * Option: <code>database-force-encode-text</code>.
55      * If true, the database layer will explicitly decode/encode strings using the MMBase encoding when
56      * storing and retrieving text from the database.
57      * The default is <code>false</code>
58      */

59     public static final String JavaDoc FORCE_ENCODE_TEXT = "database-force-encode-text";
60
61     /**
62      * If the database is ISO-8859-1, then you can switch this option to true, to store CP1252 in it.
63      */

64     public static final String JavaDoc LIE_CP1252 = "database-lie-cp1252";
65
66
67     /**
68      * Option: <code>database-supports-blob</code>.
69      * When true, the driver/database used supports the JDBC getBlob() method.
70      * The default is <code>false</code>
71      */

72     public static final String JavaDoc SUPPORTS_BLOB = "database-supports-blob";
73
74     /**
75      * Option: <code>database-supports-composite-index</code>.
76      * When true, the database uses composite indices for 'key' fields.
77      * When false, it uses single indices (a separate index for each field)
78      * The default is <code>true</code>
79      */

80     public static final String JavaDoc SUPPORTS_COMPOSITE_INDEX = "database-supports-composite-index";
81
82     /**
83      * Attribute: <code>database-transaction-isolation-level</code>.
84      * The transaction isolation level used for connections to the database.
85      * This determines the level of transaction support.
86      * The default is determined from the database metadata.
87      */

88     public static final String JavaDoc TRANSACTION_ISOLATION_LEVEL = "database-transaction-isolation-level";
89
90     /**
91      * Option: <code>database-supports-data-definition</code>.
92      * If true, the data definiton (table structure) can be changed using ALTER TABLE statements.
93      * Some databses (such as Informix) may have trouble with ALTER TABLE statements on OO-tables.
94      * Turn this option false for tehse databses.
95      * The default is <code>true</code>
96      */

97     public static final String JavaDoc SUPPORTS_DATA_DEFINITION = "database-supports-data-definition";
98
99     /**
100      * Option: <code>database-remove-empty-definitions</code>.
101      * If this option is true, empty parenthesis in a table definition are removed.
102      * When you create a new table that extends form another table, but which doesn't add fields,
103      * you may get a statement that looks like: <br />
104      * <code>CREATE TABLE table1 () UNDER table2</code><br />
105      * This statement will fail udner a database such as Informix, which does not accept empty
106      * parenthesis, but instead expects: <br />
107      * <code>CREATE TABLE table1 UNDER table2</code><br />
108      * On the other hand, a database such as Postgresql DOES expect the parenthesis (and fails if
109      * they are ommitted.)
110      * The default is <code>false</code>
111      */

112     public static final String JavaDoc REMOVE_EMPTY_DEFINITIONS = "database-remove-empty-definitions";
113
114     /**
115      * Option: <code>sequence-buffer-size</code>.
116      * The sequence buffer size is the number of keys that MMBase caches in the storage layer.
117      * You can use this to minimize the nr of times MMBase accesses the database to generate a new
118      * object number.
119      * When not set, the value is assumed to be 1.
120      */

121     public static final String JavaDoc SEQUENCE_BUFFER_SIZE = "sequence-buffer-size";
122
123     /**
124      * Option: <code>trim-strings</code>.
125      * Some text fields for some databases need to be trimmed.
126      * The default is <code>false</code>
127      */

128     public static final String JavaDoc TRIM_STRINGS = "trim-strings";
129
130 }
131
Popular Tags