def METHOD_NAME(self, raise_exc=False):
    """Resolve the link entity (e.g. SecretLink) via a database query."""
    if self._entity is None:
        self._entity = SecretLink.query.get(self.link_id)
        if self._entity is None and raise_exc:
            raise LookupError("could not find link: {}".format(self.dump()))
    return self._entity