@classmethod
def _sql_columns(cls):
    """
        Returns all columns defined for this entity. Every field
        corresponds to a single column in a table.

        The first `N` columns returned correspond to this entity's
        primary key, where `N` is the number of columns in the
        primary key.
        """
    cols = cls._sql_tables['primary'][:]
    for table, table_cols in cls._sql_tables['tables']:
        cols += table_cols
    return cols
