org.infoglue.cms.util.workflow
Class InfoGlueJDBCPropertySet
java.lang.Object
com.opensymphony.module.propertyset.AbstractPropertySet
com.opensymphony.module.propertyset.database.JDBCPropertySet
org.infoglue.cms.util.workflow.InfoGlueJDBCPropertySet
- All Implemented Interfaces:
- com.opensymphony.module.propertyset.PropertySet
public class InfoGlueJDBCPropertySet
- extends com.opensymphony.module.propertyset.database.JDBCPropertySet
This is an implementation of a property set manager for JDBC. It relies on
one table, called "os_propertyset" that has four columns: "type" (integer),
"keyValue" (string), "globalKey" (string), and "value" (string). This is not
likely to be enough for people who store BLOBS as properties. Of course,
those people need to get a life.
For Postgres(?):
CREATE TABLE OS_PROPERTYENTRY (GLOBAL_KEY varchar(255), ITEM_KEY varchar(255), ITEM_TYPE smallint, STRING_VALUE varchar(255), DATE_VALUE timestamp, DATA_VALUE oid, FLOAT_VALUE float8, NUMBER_VALUE numeric, primary key (GLOBAL_KEY, ITEM_KEY));
For Oracle (Thanks to Michael G. Slack!):
CREATE TABLE OS_PROPERTYENTRY (GLOBAL_KEY varchar(255), ITEM_KEY varchar(255), ITEM_TYPE smallint, STRING_VALUE varchar(255), DATE_VALUE date, DATA_VALUE long raw, FLOAT_VALUE float, NUMBER_VALUE numeric, primary key (GLOBAL_KEY, ITEM_KEY));
Other databases may require small tweaks to the table creation scripts!
Required Args
- globalKey - the globalKey to use with this PropertySet
Required Configuration
- datasource - JNDI path for the DataSource
- table.name - the table name
- col.globalKey - column name for the globalKey
- col.itemKey - column name for the itemKey
- col.itemType - column name for the itemType
- col.string - column name for the string value
- col.date - column name for the date value
- col.data - column name for the data value
- col.float - column name for the float value
- col.number - column name for the number value
- Version:
- $Revision: 1.4 $
- Author:
- Joseph B. Ottinger, Pat Lightbody
| Fields inherited from class com.opensymphony.module.propertyset.database.JDBCPropertySet |
closeConnWhenDone, ds |
| Fields inherited from class com.opensymphony.module.propertyset.AbstractPropertySet |
schema |
| Fields inherited from interface com.opensymphony.module.propertyset.PropertySet |
BOOLEAN, DATA, DATE, DOUBLE, INT, LONG, OBJECT, PROPERTIES, STRING, TEXT, XML |
|
Method Summary |
boolean |
exists(java.lang.String key)
|
protected java.lang.Object |
get(int type,
java.lang.String key)
|
protected java.sql.Connection |
getConnection()
|
java.util.Collection |
getKeys(java.lang.String prefix,
int type)
|
int |
getType(java.lang.String key)
|
void |
init(java.util.Map config,
java.util.Map args)
|
void |
remove(java.lang.String key)
|
protected void |
setImpl(int type,
java.lang.String key,
java.lang.Object value)
|
| Methods inherited from class com.opensymphony.module.propertyset.database.JDBCPropertySet |
cleanup, remove, supportsType |
| Methods inherited from class com.opensymphony.module.propertyset.AbstractPropertySet |
getAsActualType, getBoolean, getData, getDate, getDouble, getInt, getKeys, getKeys, getKeys, getLong, getObject, getProperties, getSchema, getString, getText, getXML, isSettable, setAsActualType, setBoolean, setData, setDate, setDouble, setInt, setLong, setObject, setProperties, setSchema, setString, setText, setXML, supportsTypes, toString, type, type |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
InfoGlueJDBCPropertySet
public InfoGlueJDBCPropertySet()
getKeys
public java.util.Collection getKeys(java.lang.String prefix,
int type)
throws com.opensymphony.module.propertyset.PropertyException
- Specified by:
getKeys in interface com.opensymphony.module.propertyset.PropertySet- Overrides:
getKeys in class com.opensymphony.module.propertyset.database.JDBCPropertySet
- Throws:
com.opensymphony.module.propertyset.PropertyException
getType
public int getType(java.lang.String key)
throws com.opensymphony.module.propertyset.PropertyException
- Specified by:
getType in interface com.opensymphony.module.propertyset.PropertySet- Overrides:
getType in class com.opensymphony.module.propertyset.database.JDBCPropertySet
- Throws:
com.opensymphony.module.propertyset.PropertyException
exists
public boolean exists(java.lang.String key)
throws com.opensymphony.module.propertyset.PropertyException
- Specified by:
exists in interface com.opensymphony.module.propertyset.PropertySet- Overrides:
exists in class com.opensymphony.module.propertyset.database.JDBCPropertySet
- Throws:
com.opensymphony.module.propertyset.PropertyException
init
public void init(java.util.Map config,
java.util.Map args)
- Specified by:
init in interface com.opensymphony.module.propertyset.PropertySet- Overrides:
init in class com.opensymphony.module.propertyset.database.JDBCPropertySet
remove
public void remove(java.lang.String key)
throws com.opensymphony.module.propertyset.PropertyException
- Specified by:
remove in interface com.opensymphony.module.propertyset.PropertySet- Overrides:
remove in class com.opensymphony.module.propertyset.database.JDBCPropertySet
- Throws:
com.opensymphony.module.propertyset.PropertyException
setImpl
protected void setImpl(int type,
java.lang.String key,
java.lang.Object value)
throws com.opensymphony.module.propertyset.PropertyException
- Overrides:
setImpl in class com.opensymphony.module.propertyset.database.JDBCPropertySet
- Throws:
com.opensymphony.module.propertyset.PropertyException
get
protected java.lang.Object get(int type,
java.lang.String key)
throws com.opensymphony.module.propertyset.PropertyException
- Overrides:
get in class com.opensymphony.module.propertyset.database.JDBCPropertySet
- Throws:
com.opensymphony.module.propertyset.PropertyException
getConnection
protected java.sql.Connection getConnection()
throws java.sql.SQLException
- Overrides:
getConnection in class com.opensymphony.module.propertyset.database.JDBCPropertySet
- Throws:
java.sql.SQLException
Copyright © 2005 InfoGlue.org All Rights Reserved.