<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_user_roles(self, user):
 """Retrieve a list of user role names. .. note:: Database management methods. """


        # For SQL: user.roles is list of pointers to Role objects
        if isinstance(self.db_adapter, SQLDbAdapter):
            # user.roles is a list of Role IDs
            user_roles = [role.name for role in user.roles]


        # For others: user.roles is a list of role names
        else:
            # user.roles is a list of role names
            user_roles = user.roles

        return user_roles