Am I correct in thinking that with the TurbineUserPeer class in the method
public static Vector doSelect(Criteria criteria),
you are limited to what type of objects you may retrieve from the Permanent
Storage?


I would like to store an object of my own design in permanent storage, would
it be possible to make the following change (or something with a similar
effect)

 for( int j=0; j<columnNames.length; j++ )
            {
                if ( !
( columnNames[j].equalsIgnoreCase( VISITOR_ID_COLUMN )
                    ||
 columnNames[j].equalsIgnoreCase( OBJECT_DATA_COLUMN ) ))
                {
                    Object obj2 = null;
                    Value value = columns[j];

                    /************ Requested change ******************
                    obj2 = value.getValue();
                    *******************************************************/
                    if (value.isByte()) obj2 = new Byte(value.asByte());
                    if (value.isBigDecimal()) obj2 = value.asBigDecimal();
                    if (value.isBytes()) obj2 = value.asBytes();
                    if (value.isDate()) obj2 = value.asDate();
                    if (value.isShort()) obj2 = new Short(value.asShort());
                    if (value.isInt()) obj2 = new Integer(value.asInt());
                    if (value.isLong()) obj2 = new Long(value.asLong());
                    if (value.isDouble()) obj2 = new
Double(value.asDouble());
                    if (value.isFloat()) obj2 = new Float(value.asFloat());
                    if (value.isBoolean()) obj2 = new
Boolean(value.asBoolean());
                    if (value.isString()) obj2 = value.asString();
                    if (value.isTime()) obj2 = value.asTime();
                    if (value.isTimestamp()) obj2 = value.asTimestamp();
                    if (value.isUtilDate()) obj2 = value.asUtilDate();
                    if ( obj2 != null )
                        tempHash.put( criteriaKeys[j], obj2 );
                }
            }
            obj.setPermStorage( tempHash );


Also the setValue(Object value) method in com.workingdogs.village.Value
would have to be changed so the switch ended like this:

default:
                valueObject = rs.getObject (columnNumber);
                break;


And finally am I right in thinking my Class would have to implement it's own
Cloneable method, since you clone the Permanent Storage Hashtable when you
save it to the database?

If I have got confused about this and there is a better way of doing it, or
there are ramifications I am not aware of please let me know. But this
change would be very useful to me.

Thanks for your help

Andrew




------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to