               updated.
     */
     public func update(db: Database) throws {
-        let changes = try DataMapper(self).update(db)
-        
-        // if no row was updated, we have a problem.
-        guard changes.changedRowCount > 0 else {
+        // We'll throw RowModelError.RowModelNotFound if rowModel does not exist.
+        let exists: Bool
+        
+        if let statement = try DataMapper(self).updateStatement(db) {
+            let changes = try statement.execute()
+            exists = changes.changedRowCount > 0
+        } else {
+            // No statement means that there is no column to update.
+            //
+            // I remember opening rdar://problem/10236982 because CoreData
+            // was crashing with entities without any attribute. So let's
+            // accept RowModel that don't have any column to update.
+            exists = self.exists(db)
+        }
+        
+        if !exists {
             throw RowModelError.RowModelNotFound(self)
         }
         

            let selectStatement = DataMapper.selectStatement(db, tableName: databaseTable.name, conditionColumns: Array(primaryKeyDictionary.keys))
            selectStatement.arguments = QueryArguments(primaryKeyDictionary.values)
            return selectStatement
        }
        
        

        } else {
            throw RowModelError.RowModelNotFound(self)
        }
    }
    
    /**
    Returns true if and only if the primary key matches a row in the database.
    
    - parameter db: A Database.
    - returns: Whether the primary key matches a row in the database.
    */
    public func exists(db: Database) -> Bool {
        return (DataMapper(self).existsStatement(db).fetchOneRow() != nil)
    }
    
    
