biz.hammurapi.web.properties
Class DbPropertySet

java.lang.Object
  extended bybiz.hammurapi.sql.DatabaseObject
      extended bybiz.hammurapi.web.property.sql.PropertySetImpl
          extended bybiz.hammurapi.web.properties.DbPropertySet
All Implemented Interfaces:
biz.hammurapi.util.Attributable, java.lang.Cloneable, biz.hammurapi.sql.columns.ColumnChangeListener, biz.hammurapi.config.Context, biz.hammurapi.config.ContextConfigurable, biz.hammurapi.sql.DataAccessObject, biz.hammurapi.config.DomConfigurable, biz.hammurapi.xml.dom.DomSerializable, biz.hammurapi.sql.IDatabaseObject, biz.hammurapi.config.MutableContext, biz.hammurapi.util.Observable, PersistentPropertySet, PropertySet, biz.hammurapi.web.property.sql.PropertySet, java.io.Serializable, biz.hammurapi.util.Versioned

public class DbPropertySet
extends biz.hammurapi.web.property.sql.PropertySetImpl
implements PersistentPropertySet, biz.hammurapi.sql.DataAccessObject

See Also:
Serialized Form

Field Summary
 
Fields inherited from class biz.hammurapi.web.property.sql.PropertySetImpl
Description, Id, Name, OwnerId, OwnerType
 
Fields inherited from class biz.hammurapi.sql.DatabaseObject
columns, objectVersion, originalVersion
 
Constructor Summary
DbPropertySet()
           
DbPropertySet(boolean force)
           
DbPropertySet(java.sql.ResultSet rs)
           
 
Method Summary
 void clear()
          Removes all entries from the property set
 boolean compareProperties(PropertySet otherSet)
           
 boolean containsAll(PropertySet subSet)
           
 void delete()
          Deletes property set from the database.
 java.lang.Object get(java.lang.String name)
           
 java.util.Set getPropertyNames()
           
 PropertySet getSubset(java.lang.String prefix)
           
 void load(PropertySet source)
          Loads all entries from the source to this property set
 void mount(java.lang.String prefix, PropertySet source)
          Mounts source property set at specified prefix.
 void remove(java.lang.String name)
          Removes property from the set.
 void set(java.lang.String name, java.lang.Object value)
           
 void setAll(PropertySet source)
          Copies all entries from the source property set to self.
 void setSQLProcessor(biz.hammurapi.sql.SQLProcessor processor)
           
 void toDom(org.w3c.dom.Element holder)
           
 void update()
          Updates set information (name, description, owner, ...) in the databse
 
Methods inherited from class biz.hammurapi.web.property.sql.PropertySetImpl
clone, getDescription, getId, getName, getOwnerId, getOwnerType, project, project, setDescription, setId, setName, setOwnerId, setOwnerType
 
Methods inherited from class biz.hammurapi.sql.DatabaseObject
addColumn, addObserver, addRelationship, configure, configure, copy, delete, equals, fromDom, fromDom, getAttribute, getColumn, getColumnAttribute, getObjectVersion, getRelationship, getSqlType, hashCode, insert, isDeleted, isModified, loadRelationships, onChange, removeAttribute, removeColumnAttribute, removeObserver, setAttribute, setColumnAttribute, setOriginal, toDom, toString, update
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface biz.hammurapi.web.property.sql.PropertySet
getDescription, getId, getName, getOwnerId, getOwnerType, setDescription, setId, setName, setOwnerId, setOwnerType
 

Constructor Detail

DbPropertySet

public DbPropertySet()

DbPropertySet

public DbPropertySet(boolean force)

DbPropertySet

public DbPropertySet(java.sql.ResultSet rs)
              throws java.sql.SQLException
Method Detail

delete

public void delete()
            throws java.sql.SQLException
Description copied from interface: PersistentPropertySet
Deletes property set from the database.

Specified by:
delete in interface PersistentPropertySet
Throws:
java.sql.SQLException

getPropertyNames

public java.util.Set getPropertyNames()
Specified by:
getPropertyNames in interface PropertySet
Returns:
Names of properties in the set

getSubset

public PropertySet getSubset(java.lang.String prefix)
Specified by:
getSubset in interface PropertySet
Parameters:
prefix -
Returns:
Property set which operates on properties starting with given prefix.

remove

public void remove(java.lang.String name)
Description copied from interface: PropertySet
Removes property from the set.

Specified by:
remove in interface PropertySet
Parameters:
name -

set

public void set(java.lang.String name,
                java.lang.Object value)
Specified by:
set in interface biz.hammurapi.config.MutableContext

setSQLProcessor

public void setSQLProcessor(biz.hammurapi.sql.SQLProcessor processor)
                     throws java.sql.SQLException
Specified by:
setSQLProcessor in interface biz.hammurapi.sql.DataAccessObject
Throws:
java.sql.SQLException

get

public java.lang.Object get(java.lang.String name)
Specified by:
get in interface biz.hammurapi.config.Context

update

public void update()
            throws java.sql.SQLException
Updates set information (name, description, owner, ...) in the databse

Specified by:
update in interface PersistentPropertySet
Throws:
java.sql.SQLException

load

public void load(PropertySet source)
Description copied from interface: PropertySet
Loads all entries from the source to this property set

Specified by:
load in interface PropertySet
Parameters:
source -

mount

public void mount(java.lang.String prefix,
                  PropertySet source)
Description copied from interface: PropertySet
Mounts source property set at specified prefix. E.g. if source property set has entry 'a' and prefix is 'b/' then that entry will be available as 'b/a'. Own property set entries shall shadow mounted entries.

Specified by:
mount in interface PropertySet
Parameters:
prefix -
source -

clear

public void clear()
Description copied from interface: PropertySet
Removes all entries from the property set

Specified by:
clear in interface PropertySet

toDom

public void toDom(org.w3c.dom.Element holder)
Specified by:
toDom in interface biz.hammurapi.xml.dom.DomSerializable

setAll

public void setAll(PropertySet source)
Description copied from interface: PropertySet
Copies all entries from the source property set to self.

Specified by:
setAll in interface PropertySet
Parameters:
source -

compareProperties

public boolean compareProperties(PropertySet otherSet)
Specified by:
compareProperties in interface PropertySet
Parameters:
otherSet -
Returns:
true if other property set entries are equal to this property set entries. Other Property set attribute

containsAll

public boolean containsAll(PropertySet subSet)
Specified by:
containsAll in interface PropertySet
Parameters:
subSet -
Returns:
true if all properties of subset are present in this set with same values


Copyright © 2006 Hammurapi Group. All Rights Reserved.