public function calculateHash($recursive = false) {
        if (!$this->loaded) {
            $this->hash = null;
        } else {
            $defaulthash = is_null($this->default) ? '' : sha1($this->default);
            $key = $this->name . $this->type . $this->length .
                   $this->notnull . $this->sequence .
                   $this->decimals . $this->comment . $defaulthash;
            $this->hash = md5($key);
        }
    }