@Override
	public DBRecord translateRecord(DBRecord oldRec) {
		if (oldRec == null) {
			return null;
		}
		DBRecord rec = FunctionDefinitionDBAdapter.FUN_DEF_SCHEMA.createRecord(oldRec.getKey());
		rec.setString(FUNCTION_DEF_NAME_COL, oldRec.getString(V1_FUNCTION_DEF_NAME_COL));
		rec.setString(FUNCTION_DEF_COMMENT_COL, oldRec.getString(V1_FUNCTION_DEF_COMMENT_COL));
		rec.setLongValue(FUNCTION_DEF_CAT_ID_COL, oldRec.getLongValue(V1_FUNCTION_DEF_CAT_ID_COL));
		rec.setLongValue(FUNCTION_DEF_RETURN_ID_COL, oldRec.getLongValue(V1_FUNCTION_DEF_RETURN_ID_COL));
		
		byte flags = oldRec.getByteValue(V1_FUNCTION_DEF_FLAGS_COL);
		int mask = GENERIC_CALLING_CONVENTION_FLAG_MASK << GENERIC_CALLING_CONVENTION_FLAG_SHIFT;
		int genericCallConvId = (flags & mask) >> GENERIC_CALLING_CONVENTION_FLAG_SHIFT;
		flags &= (byte) (~mask); // clear old flag bits used for calling convention

		byte callingConventionId = DataTypeManagerDB.UNKNOWN_CALLING_CONVENTION_ID;
		try {
			if (callConvAdapter == null) {
				// Must use old generic calling convention ordinal as ID
				callingConventionId = (byte) genericCallConvId;
			}
			else {
				// It is expected that an open transaction exists during upgrade use
				// and that all records are upgraded prior to general use
				String callingConvention = getGenericCallingConventionName(genericCallConvId);
				callingConventionId = callConvAdapter.getCallingConventionId(callingConvention,
					cc -> {
						/* ignore */ });
			}
		}
		catch (IOException e) {
			// ignore - use unknown convention ID
		}

		rec.setByteValue(FUNCTION_DEF_FLAGS_COL, flags);
		rec.setByteValue(FUNCTION_DEF_CALLCONV_COL, callingConventionId);
		rec.setLongValue(FUNCTION_DEF_SOURCE_ARCHIVE_ID_COL, DataTypeManager.LOCAL_ARCHIVE_KEY);
		rec.setLongValue(FUNCTION_DEF_SOURCE_DT_ID_COL, UniversalIdGenerator.nextID().getValue());
		rec.setLongValue(FUNCTION_DEF_SOURCE_SYNC_TIME_COL, DataType.NO_SOURCE_SYNC_TIME);
		rec.setLongValue(FUNCTION_DEF_LAST_CHANGE_TIME_COL, DataType.NO_LAST_CHANGE_TIME);
		return rec;
	}
Gets a version 1 read-only adapter for the Function Definition database table.
@param handle handle to the database containing the table.
@param tablePrefix prefix to be used with default table name
@param callConvAdapter calling convention table adapter suitable to add new conventions
(e.g., this adapter being used during upgrade operation).  Should be null if not performing
an upgrade in which case calling convention IDs will reflect generic convention ordinals.

@throws VersionException if the table's version does not match the expected version
for this adapter.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/FunctionDefinitionDBAdapterV1.java