001: /*
002:
003: This software is OSI Certified Open Source Software.
004: OSI Certified is a certification mark of the Open Source Initiative.
005:
006: The license (Mozilla version 1.0) can be read at the MMBase site.
007: See http://www.MMBase.org/license
008:
009: */
010: package org.mmbase.storage.implementation.database;
011:
012: /**
013: * This class defines the attributes names used by the default database storage manager classes.
014: * Specific storage managers may ignore or add their own attributes.
015: *
016: * @author Pierre van Rooden
017: * @since MMBase-1.7
018: * @version $Id: Attributes.java,v 1.14 2005/02/03 09:21:38 michiel Exp $
019: */
020: public final class Attributes {
021:
022: /**
023: * Attribute: <code>database-data-source</code>.
024: * The data source object used by the storage layer.
025: * This attribute is set by the storagelayer and returns a javax.sql.DataSource object.
026: * You should not set or configure this attribute (but you can retrieve it).
027: */
028: public static final String DATA_SOURCE = "database-data-source";
029:
030: /**
031: * Option: <code>database-supports-transactions</code>.
032: * When true, the database supports transactions.
033: * The default is determined form the database, but you can override it.
034: */
035: public static final String SUPPORTS_TRANSACTIONS = "database-supports-transactions";
036:
037: /**
038: * Option: <code>database-stores-binary-as-file</code>.
039: * When true, binary data is stored on disk, rather than in the database.
040: * If you set this option ou should also set the attribute {@link #BINARY_FILE_PATH}
041: * The default is <code>false</code>
042: */
043: public static final String STORES_BINARY_AS_FILE = "database-stores-binary-as-file";
044:
045: /**
046: * Attribute: <code>database-binary-file-path</code>.
047: * The path to the directyory where binary files are to be stored if {@link #STORES_BINARY_AS_FILE} is true.
048: * The default is the WEB-INF/data directory of the mmbase web application.
049: * Note that if you specify a relative url, it is taken from the web application's webroot.
050: */
051: public static final String BINARY_FILE_PATH = "database-binary-file-path";
052:
053: /**
054: * Option: <code>database-force-encode-text</code>.
055: * If true, the database layer will explicitly decode/encode strings using the MMBase encoding when
056: * storing and retrieving text from the database.
057: * The default is <code>false</code>
058: */
059: public static final String FORCE_ENCODE_TEXT = "database-force-encode-text";
060:
061: /**
062: * If the database is ISO-8859-1, then you can switch this option to true, to store CP1252 in it.
063: */
064: public static final String LIE_CP1252 = "database-lie-cp1252";
065:
066: /**
067: * Option: <code>database-supports-blob</code>.
068: * When true, the driver/database used supports the JDBC getBlob() method.
069: * The default is <code>false</code>
070: */
071: public static final String SUPPORTS_BLOB = "database-supports-blob";
072:
073: /**
074: * Option: <code>database-supports-composite-index</code>.
075: * When true, the database uses composite indices for 'key' fields.
076: * When false, it uses single indices (a separate index for each field)
077: * The default is <code>true</code>
078: */
079: public static final String SUPPORTS_COMPOSITE_INDEX = "database-supports-composite-index";
080:
081: /**
082: * Attribute: <code>database-transaction-isolation-level</code>.
083: * The transaction isolation level used for connections to the database.
084: * This determines the level of transaction support.
085: * The default is determined from the database metadata.
086: */
087: public static final String TRANSACTION_ISOLATION_LEVEL = "database-transaction-isolation-level";
088:
089: /**
090: * Option: <code>database-supports-data-definition</code>.
091: * If true, the data definiton (table structure) can be changed using ALTER TABLE statements.
092: * Some databses (such as Informix) may have trouble with ALTER TABLE statements on OO-tables.
093: * Turn this option false for tehse databses.
094: * The default is <code>true</code>
095: */
096: public static final String SUPPORTS_DATA_DEFINITION = "database-supports-data-definition";
097:
098: /**
099: * Option: <code>database-remove-empty-definitions</code>.
100: * If this option is true, empty parenthesis in a table definition are removed.
101: * When you create a new table that extends form another table, but which doesn't add fields,
102: * you may get a statement that looks like: <br />
103: * <code>CREATE TABLE table1 () UNDER table2</code><br />
104: * This statement will fail udner a database such as Informix, which does not accept empty
105: * parenthesis, but instead expects: <br />
106: * <code>CREATE TABLE table1 UNDER table2</code><br />
107: * On the other hand, a database such as Postgresql DOES expect the parenthesis (and fails if
108: * they are ommitted.)
109: * The default is <code>false</code>
110: */
111: public static final String REMOVE_EMPTY_DEFINITIONS = "database-remove-empty-definitions";
112:
113: /**
114: * Option: <code>sequence-buffer-size</code>.
115: * The sequence buffer size is the number of keys that MMBase caches in the storage layer.
116: * You can use this to minimize the nr of times MMBase accesses the database to generate a new
117: * object number.
118: * When not set, the value is assumed to be 1.
119: */
120: public static final String SEQUENCE_BUFFER_SIZE = "sequence-buffer-size";
121:
122: /**
123: * Option: <code>trim-strings</code>.
124: * Some text fields for some databases need to be trimmed.
125: * The default is <code>false</code>
126: */
127: public static final String TRIM_STRINGS = "trim-strings";
128:
129: }
|