/** Removes attribute from database Requires U2DbiFeature_WriteAttribute feature support */ void MysqlAttributeDbi::removeAttributes(const QList<U2DataId>& attributeIds, U2OpStatus& os) { MysqlTransaction t(db, os); Q_UNUSED(t); static const QString mainQueryStr("DELETE FROM Attribute WHERE id = :attribute"); static const QString secQueryStr("DELETE FROM %1 WHERE attribute = :attribute"); static const QString intergerAttrString = "IntegerAttribute"; static const QString realAttrString = "RealAttribute"; static const QString stringAttrString = "StringAttribute"; static const QString bytearrayAttrString = "ByteArrayAttribute"; QString tableName; foreach (const U2DataId& id, attributeIds) { U2DataType type = U2DbiUtils::toType(id); switch (type) { case U2Type::AttributeInteger: tableName = intergerAttrString; break; case U2Type::AttributeReal: tableName = realAttrString; break; case U2Type::AttributeString: tableName = stringAttrString; break; case U2Type::AttributeByteArray: tableName = bytearrayAttrString; break; default: os.setError(U2DbiL10n::tr("Unsupported attribute type: %1").arg(type)); break; } U2SqlQuery removeAttrDetails(secQueryStr.arg(tableName), db, os); removeAttrDetails.bindDataId(":attribute", id); removeAttrDetails.execute(); CHECK_OP(os, ); U2SqlQuery removeAttr(mainQueryStr, db, os); removeAttr.bindDataId(":attribute", id); removeAttr.execute(); CHECK_OP(os, ); }
//-------------------------------------------------------------------------- // Function: H5Object::removeAttr ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes /// a reference to an \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Object::removeAttr( const H5std_string& name ) const { removeAttr( name.c_str() ); }
void PropertyFS::unit(const nix::none_t t) { if (hasAttr("unit")) { removeAttr("unit"); } forceUpdatedAt(); }
void PropertyFS::mapping(const nix::none_t t) { if (hasAttr("mapping")) { removeAttr("mapping"); forceUpdatedAt(); } }
void PropertyFS::definition(const nix::none_t t) { if (hasAttr("definition")) { removeAttr("definition"); } forceUpdatedAt(); }
//-------------------------------------------------------------------------- // Function: H5Location::removeAttr ///\brief This is an overloaded member function, provided for convenience. /// It differs from the above function in that it takes /// a reference to an \c H5std_string for \a name. // Programmer Binh-Minh Ribler - 2000 //-------------------------------------------------------------------------- void H5Location::removeAttr( const H5std_string& name ) const { removeAttr( name.c_str() ); }