Search in sources :

Example 1 with FormatableHashtable

use of org.apache.derby.iapi.services.io.FormatableHashtable in project derby by apache.

the class IndexDescriptorImpl method writeExternal.

/**
 * @see java.io.Externalizable#writeExternal
 *
 * @exception IOException	Thrown on write error
 */
public void writeExternal(ObjectOutput out) throws IOException {
    FormatableHashtable fh = new FormatableHashtable();
    fh.putBoolean("isUnique", isUnique);
    fh.putInt("keyLength", baseColumnPositions.length);
    for (int i = 0; i < baseColumnPositions.length; i++) {
        fh.putInt("bcp" + i, baseColumnPositions[i]);
        fh.putBoolean("isAsc" + i, isAscending[i]);
    }
    fh.putInt("orderedColumns", numberOfOrderedColumns);
    fh.put("indexType", indexType);
    // write the new attribut older versions will simply ignore it
    fh.putBoolean("isUniqueWithDuplicateNulls", isUniqueWithDuplicateNulls);
    fh.putBoolean("hasDeferrableChecking", hasDeferrableChecking);
    fh.putBoolean("isUniqueDeferrable", isUniqueDeferrable);
    out.writeObject(fh);
}
Also used : FormatableHashtable(org.apache.derby.iapi.services.io.FormatableHashtable)

Example 2 with FormatableHashtable

use of org.apache.derby.iapi.services.io.FormatableHashtable in project derby by apache.

the class GenericColumnDescriptor method readExternal.

/**
 * Read this object from a stream of stored objects.
 *
 * @param in read this.
 *
 * @exception IOException					thrown on error
 * @exception ClassNotFoundException		thrown on error
 */
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    FormatableHashtable fh = (FormatableHashtable) in.readObject();
    name = (String) fh.get("name");
    tableName = (String) fh.get("tableName");
    schemaName = (String) fh.get("schemaName");
    columnPos = fh.getInt("columnPos");
    type = getStoredDataTypeDescriptor(fh.get("type"));
    isAutoincrement = fh.getBoolean("isAutoincrement");
    updatableByCursor = fh.getBoolean("updatableByCursor");
}
Also used : FormatableHashtable(org.apache.derby.iapi.services.io.FormatableHashtable)

Example 3 with FormatableHashtable

use of org.apache.derby.iapi.services.io.FormatableHashtable in project derby by apache.

the class BasicProviderInfo method readExternal.

// Formatable methods
/**
 * Read this object from a stream of stored objects.
 *
 * @param in read this.
 *
 * @exception IOException					thrown on error
 * @exception ClassNotFoundException		thrown on error
 */
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
    FormatableHashtable fh = (FormatableHashtable) in.readObject();
    uuid = (UUID) fh.get("uuid");
    dFinder = (DependableFinder) fh.get("dFinder");
    providerName = (String) fh.get("providerName");
}
Also used : FormatableHashtable(org.apache.derby.iapi.services.io.FormatableHashtable)

Example 4 with FormatableHashtable

use of org.apache.derby.iapi.services.io.FormatableHashtable in project derby by apache.

the class ColumnInfo method writeExternal.

/**
 * Write this object to a stream of stored objects.
 *
 * @param out write bytes here.
 *
 * @exception IOException		thrown on error
 */
public void writeExternal(ObjectOutput out) throws IOException {
    FormatableHashtable fh = new FormatableHashtable();
    fh.put("name", name);
    fh.put("dataType", dataType);
    fh.put("defaultValue", defaultValue);
    fh.put("defaultInfo", defaultInfo);
    fh.put("newDefaultUUID", newDefaultUUID);
    fh.put("oldDefaultUUID", oldDefaultUUID);
    fh.putInt("action", action);
    if (autoincInc != 0) {
        // only write out autoinc values if its an autoinc column.
        fh.putLong("autoincStart", autoincStart);
        fh.putLong("autoincInc", autoincInc);
    }
    if (providers != null) {
        FormatableArrayHolder fah = new FormatableArrayHolder(providers);
        fh.put("providers", fah);
    }
    out.writeObject(fh);
}
Also used : FormatableHashtable(org.apache.derby.iapi.services.io.FormatableHashtable) FormatableArrayHolder(org.apache.derby.iapi.services.io.FormatableArrayHolder)

Example 5 with FormatableHashtable

use of org.apache.derby.iapi.services.io.FormatableHashtable in project derby by apache.

the class CacheLock method savePropertyDefault.

void savePropertyDefault(TransactionController tc, String key, Serializable value) throws StandardException {
    if (saveServiceProperty(key, value))
        return;
    FormatableHashtable defaults = (FormatableHashtable) readProperty(tc, AccessFactoryGlobals.DEFAULT_PROPERTY_NAME);
    if (defaults == null)
        defaults = new FormatableHashtable();
    if (value == null)
        defaults.remove(key);
    else
        defaults.put(key, value);
    if (defaults.size() == 0)
        defaults = null;
    saveProperty(tc, AccessFactoryGlobals.DEFAULT_PROPERTY_NAME, (Serializable) defaults);
}
Also used : FormatableHashtable(org.apache.derby.iapi.services.io.FormatableHashtable)

Aggregations

FormatableHashtable (org.apache.derby.iapi.services.io.FormatableHashtable)14 FormatableArrayHolder (org.apache.derby.iapi.services.io.FormatableArrayHolder)2 FormatableLongHolder (org.apache.derby.iapi.services.io.FormatableLongHolder)1