com.amazon.carbonado.lob
Class AbstractClob

java.lang.Object
  extended by com.amazon.carbonado.lob.AbstractClob
All Implemented Interfaces:
Clob, Lob
Direct Known Subclasses:
BlobClob, CharArrayClob, StringClob

public abstract class AbstractClob
extends Object
implements Clob

AbstractClob implements a small set of common Clob methods.

Author:
Brian S O'Neill

Constructor Summary
protected AbstractClob()
           
protected AbstractClob(Repository repo)
          Use of this constructor indicates that setValue should operate within a transaction.
 
Method Summary
 String asString()
          Convenience method to capture all the Clob data as a single String.
 boolean equals(Object obj)
          Two Lobs are considered equal if the object instances are the same or if they point to the same content.
 int hashCode()
           
 void setValue(String value)
          Convenience method to overwrite all Clob data with the value of a single String.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.amazon.carbonado.lob.Clob
getLength, openReader, openReader, openReader, openWriter, openWriter, openWriter, setLength
 
Methods inherited from interface com.amazon.carbonado.lob.Lob
getLocator
 

Constructor Detail

AbstractClob

protected AbstractClob()

AbstractClob

protected AbstractClob(Repository repo)
Use of this constructor indicates that setValue should operate within a transaction. A Repository is passed in for entering the transaction.

Parameters:
repo - optional repository to use for performing string conversion within transactions
Method Detail

asString

public String asString()
                throws FetchException
Description copied from interface: Clob
Convenience method to capture all the Clob data as a single String. Call within a transaction scope to ensure the data does not change while the String is being built.

Specified by:
asString in interface Clob
Throws:
FetchException

setValue

public void setValue(String value)
              throws PersistException
Description copied from interface: Clob
Convenience method to overwrite all Clob data with the value of a single String. The Clob length may grow or shrink, to match the String value. Call within a transaction scope to ensure the data and length does not change while the value is set.

Specified by:
setValue in interface Clob
Parameters:
value - Clob is overwritten with this value
Throws:
PersistException

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Description copied from interface: Lob
Two Lobs are considered equal if the object instances are the same or if they point to the same content. Lob data is not compared, as that would be expensive or it may result in a fetch exception.

Specified by:
equals in interface Lob
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.