wt.federation
Class ObjectOutputTable

java.lang.Object
  extended bywt.federation.ObjectOutputTable
All Implemented Interfaces:
PersistentStoreIfc

public class ObjectOutputTable
extends Object
implements PersistentStoreIfc

ObjectOutputTable generates a Hashtable of objects where each object is the string representation of a property of an ObjectMappable object. ObjectOutputTable implements the Windchill Persistent Store Interface.


Field Summary
private  Hashtable attributeTable
           
private  String prefix
           
private static String versionID
           
 
Constructor Summary
ObjectOutputTable()
          Create an ObjectOutputTable instance.
ObjectOutputTable(String prefix)
          Create an ObjectOutputTable instance initialized with a specified attribute name prefix.
 
Method Summary
 void close()
          Close the table.
static Hashtable createAttributeTable(Persistable obj)
          Static convenience method that returns an attribute table given a Persistable object.
 Hashtable getAttributeTable()
          Return the currently defined attribute table.
 String getContainer()
          Get the current container name.
 void setAsciiStream(String attributeName, InputStream aStream, int len)
          Set the value to an ascii stream.
 void setBigDecimal(String attributeName, BigDecimal aBigDecimal)
          Set the value to a BigDecimal.
 void setBinaryStream(String attributeName, InputStream aStream, int len)
          Set the value to a binary stream.
 void setBoolean(String attributeName, boolean aBool)
          Set the value to a Java boolean.
 void setBooleanObject(String attributeName, Boolean aBool)
          Set the value to a Java boolean.
 void setByte(String attributeName, byte aByte)
          Set the value to a Java byte.
 void setByteObject(String attributeName, Byte aByte)
          Set the value to a Java byte.
 void setBytes(String attributeName, byte[] bArray)
          Set the value to a Java byte array.
 void setChar(String attributeName, char aChar)
          Set the value to a Java char.
 void setCharObject(String attributeName, Character aChar)
          Set the value to a Java char.
 void setDate(String attributeName, Date aDate)
          Set the value to a java.util.Date.
 void setDouble(String attributeName, double aDbl)
          Set the value to a Java double.
 void setDoubleObject(String attributeName, Double aDbl)
          Set the value to a Java double.
 void setFloat(String attributeName, float aFloat)
          Set the value to a Java float.
 void setFloatObject(String attributeName, Float aFloat)
          Set the value to a Java float.
 void setInlineObject(String attributeName, String blobAttributeName, Serializable anObj)
          Set the value to a Java Serializable Object.
 void setInt(String attributeName, int anInt)
          Set the value to a Java int.
 void setIntObject(String attributeName, Integer anInt)
          Set the value to a Java int.
 void setLobLocator(String attributeName, LobLocator aLL)
          Set the value to a Lob locator.
 void setLong(String attributeName, long aLong)
          Set the value to a Java long.
 void setLongObject(String attributeName, Long aLong)
          Set the value to a Java long.
 void setNull(String attributeName, int sqltype)
          Set the value to a null.
 void setObject(String attributeName, Object anObj)
          Set the value to a Java object.
 void setShort(String attributeName, short aShort)
          Set the value to a Java short.
 void setShortObject(String attributeName, Short aShort)
          Set the value to a Java short.
 void setSmallObject(String attributeName, Serializable anObj)
          Set the value to a Java object.
 void setString(String attributeName, String aString)
          Set the value to a Java String.
 void setTime(String attributeName, Time aTime)
          Set the value to a Java Time.
 void setTimestamp(String attributeName, Timestamp aTimestamp)
          Set the value to a Java Timestamp.
 void setUnicodeStream(String attributeName, InputStream aStream, int len)
          Set the value to a Java Unicode stream.
 void writeObject(String attribute_name, ObjectMappable obj, Class concrete_class, boolean isRequired)
          Set the values corresponding to a nested ObjectMappable Object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

versionID

private static final String versionID
See Also:
Constant Field Values

attributeTable

private Hashtable attributeTable

prefix

private String prefix
Constructor Detail

ObjectOutputTable

public ObjectOutputTable()
Create an ObjectOutputTable instance.


ObjectOutputTable

public ObjectOutputTable(String prefix)
Create an ObjectOutputTable instance initialized with a specified attribute name prefix.

Parameters:
prefix - attribute name prefix
Method Detail

createAttributeTable

public static Hashtable createAttributeTable(Persistable obj)
                                      throws FederationServicesException
Static convenience method that returns an attribute table given a Persistable object.

Parameters:
obj - object from which to create an attribute table
Returns:
Hashtable the resulting attribute table
Throws:
FederationServicesException

getAttributeTable

public Hashtable getAttributeTable()
Return the currently defined attribute table.

Returns:
Hashtable the current attribute table

close

public void close()
Close the table.


setAsciiStream

public void setAsciiStream(String attributeName,
                           InputStream aStream,
                           int len)
                    throws SQLException
Set the value to an ascii stream.

Specified by:
setAsciiStream in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aStream - the parameter value
len - the length of the input stream
Throws:
SQLException - if a database-access error occurs.

setBigDecimal

public void setBigDecimal(String attributeName,
                          BigDecimal aBigDecimal)
                   throws SQLException
Set the value to a BigDecimal.

Specified by:
setBigDecimal in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aBigDecimal - the parameter value
Throws:
SQLException - if a database-access error occurs.

setBinaryStream

public void setBinaryStream(String attributeName,
                            InputStream aStream,
                            int len)
                     throws SQLException
Set the value to a binary stream.

Specified by:
setBinaryStream in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aStream - the parameter value
len - the length of the input stream
Throws:
SQLException - if a database-access error occurs.

setBoolean

public void setBoolean(String attributeName,
                       boolean aBool)
                throws SQLException
Set the value to a Java boolean.

Specified by:
setBoolean in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aBool - the parameter value
Throws:
SQLException - if a database-access error occurs.

setBooleanObject

public void setBooleanObject(String attributeName,
                             Boolean aBool)
                      throws SQLException
Set the value to a Java boolean.

Specified by:
setBooleanObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aBool - the parameter value
Throws:
SQLException - if a database-access error occurs.

setByte

public void setByte(String attributeName,
                    byte aByte)
             throws SQLException
Set the value to a Java byte.

Specified by:
setByte in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aByte - the parameter value
Throws:
SQLException - if a database-access error occurs.

setByteObject

public void setByteObject(String attributeName,
                          Byte aByte)
                   throws SQLException
Set the value to a Java byte.

Specified by:
setByteObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aByte - the parameter value
Throws:
SQLException - if a database-access error occurs.

setBytes

public void setBytes(String attributeName,
                     byte[] bArray)
              throws SQLException
Set the value to a Java byte array.

Specified by:
setBytes in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
bArray - the parameter value
Throws:
SQLException - if a database-access error occurs.

setChar

public void setChar(String attributeName,
                    char aChar)
             throws SQLException
Set the value to a Java char.

Specified by:
setChar in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aChar - the parameter value
Throws:
SQLException - if a database-access error occurs.

setCharObject

public void setCharObject(String attributeName,
                          Character aChar)
                   throws SQLException
Set the value to a Java char.

Specified by:
setCharObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aChar - the parameter value
Throws:
SQLException - if a database-access error occurs.

setDate

public void setDate(String attributeName,
                    Date aDate)
             throws SQLException
Set the value to a java.util.Date.

Specified by:
setDate in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aDate - the parameter value
Throws:
SQLException - if a database-access error occurs.

setDouble

public void setDouble(String attributeName,
                      double aDbl)
               throws SQLException
Set the value to a Java double.

Specified by:
setDouble in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aDbl - the parameter value
Throws:
SQLException - if a database-access error occurs.

setDoubleObject

public void setDoubleObject(String attributeName,
                            Double aDbl)
                     throws SQLException
Set the value to a Java double.

Specified by:
setDoubleObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aDbl - the parameter value
Throws:
SQLException - if a database-access error occurs.

setFloat

public void setFloat(String attributeName,
                     float aFloat)
              throws SQLException
Set the value to a Java float.

Specified by:
setFloat in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aFloat - the parameter value
Throws:
SQLException - if a database-access error occurs.

setFloatObject

public void setFloatObject(String attributeName,
                           Float aFloat)
                    throws SQLException
Set the value to a Java float.

Specified by:
setFloatObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aFloat - the parameter value
Throws:
SQLException - if a database-access error occurs.

setInlineObject

public void setInlineObject(String attributeName,
                            String blobAttributeName,
                            Serializable anObj)
                     throws SQLException,
                            DatastoreException
Description copied from interface: PersistentStoreIfc
Set the value to a Java Serializable Object.

Specified by:
setInlineObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
blobAttributeName - a blob attribute name
anObj - the serializable object
Throws:
SQLException - if a database-access error occurs.
DatastoreException

setInt

public void setInt(String attributeName,
                   int anInt)
            throws SQLException
Set the value to a Java int.

Specified by:
setInt in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
anInt - the parameter value
Throws:
SQLException - if a database-access error occurs.

setIntObject

public void setIntObject(String attributeName,
                         Integer anInt)
                  throws SQLException
Set the value to a Java int.

Specified by:
setIntObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
anInt - the parameter value
Throws:
SQLException - if a database-access error occurs.

setLong

public void setLong(String attributeName,
                    long aLong)
             throws SQLException
Set the value to a Java long.

Specified by:
setLong in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aLong - the parameter value
Throws:
SQLException - if a database-access error occurs.

setLongObject

public void setLongObject(String attributeName,
                          Long aLong)
                   throws SQLException
Set the value to a Java long.

Specified by:
setLongObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aLong - the parameter value
Throws:
SQLException - if a database-access error occurs.

setNull

public void setNull(String attributeName,
                    int sqltype)
             throws SQLException
Set the value to a null.

Specified by:
setNull in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
sqltype - the SQL type of the attribute
Throws:
SQLException - if a database-access error occurs.

setObject

public void setObject(String attributeName,
                      Object anObj)
               throws SQLException
Set the value to a Java object.

Specified by:
setObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
anObj - the parameter value
Throws:
SQLException - if a database-access error occurs.

setSmallObject

public void setSmallObject(String attributeName,
                           Serializable anObj)
                    throws SQLException,
                           DatastoreException
Set the value to a Java object.

Specified by:
setSmallObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
anObj - the parameter value
Throws:
SQLException - if a database-access error occurs.
DatastoreException

setShort

public void setShort(String attributeName,
                     short aShort)
              throws SQLException
Set the value to a Java short.

Specified by:
setShort in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aShort - the parameter value
Throws:
SQLException - if a database-access error occurs.

setShortObject

public void setShortObject(String attributeName,
                           Short aShort)
                    throws SQLException
Set the value to a Java short.

Specified by:
setShortObject in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aShort - the parameter value
Throws:
SQLException - if a database-access error occurs.

setString

public void setString(String attributeName,
                      String aString)
               throws SQLException
Set the value to a Java String.

Specified by:
setString in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aString - the parameter value
Throws:
SQLException - if a database-access error occurs.

setTime

public void setTime(String attributeName,
                    Time aTime)
             throws SQLException
Set the value to a Java Time.

Specified by:
setTime in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aTime - the parameter value
Throws:
SQLException - if a database-access error occurs.

setTimestamp

public void setTimestamp(String attributeName,
                         Timestamp aTimestamp)
                  throws SQLException
Set the value to a Java Timestamp.

Specified by:
setTimestamp in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aTimestamp - the parameter value
Throws:
SQLException - if a database-access error occurs.

setUnicodeStream

public void setUnicodeStream(String attributeName,
                             InputStream aStream,
                             int len)
                      throws SQLException
Set the value to a Java Unicode stream.

Specified by:
setUnicodeStream in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aStream - the parameter value
Throws:
SQLException - if a database-access error occurs.

setLobLocator

public void setLobLocator(String attributeName,
                          LobLocator aLL)
                   throws SQLException
Set the value to a Lob locator.

Specified by:
setLobLocator in interface PersistentStoreIfc
Parameters:
attributeName - a class attribute name
aLL - the parameter value
Throws:
SQLException - if a database-access error occurs.

writeObject

public void writeObject(String attribute_name,
                        ObjectMappable obj,
                        Class concrete_class,
                        boolean isRequired)
                 throws SQLException,
                        DatastoreException
Set the values corresponding to a nested ObjectMappable Object. This results in a call the nested object's writeExternal method.

Specified by:
writeObject in interface PersistentStoreIfc
Parameters:
attribute_name - a class attribute name
obj - the nested object
concrete_class - the class of the object (in case obj is null)
Throws:
SQLException - if a database-access error occurs.
DatastoreException

getContainer

public String getContainer()
Get the current container name. The container name is set by calls to writeObject.

Specified by:
getContainer in interface PersistentStoreIfc
Returns:
the current container name