'Define a super-entity table
@param tablename: the tablename
@param key: name of the primary key
@param types: a dictionary of instance types
@param fields: any shared fields
@param args: table arguments (e.g. migrate)'

@classmethod
def super_entity(cls, tablename, key, types, *fields, **args):

    db = current.db
    if (db._dbname == 'postgres'):
        sequence_name = ('%s_%s_seq' % (tablename, key))
    else:
        sequence_name = None
    table = db.define_table(tablename, Field(key, 'id', readable=False, writable=False), Field('deleted', 'boolean', readable=False, writable=False, default=False), Field('instance_type', represent=(lambda opt: (types.get(opt, opt) or current.messages['NONE'])), readable=False, writable=False), Field('uuid', length=128, readable=False, writable=False), sequence_name=sequence_name, *fields, **args)
    return table
