ItemLinks itemLinks = new ItemLinks();
ClassDescriptor descriptor = context.getJAXBDescriptorForClass(result.getClass());
if ((result instanceof PersistenceWeavedRest) && (descriptor != null) && (context != null)) {
PersistenceWeavedRest entity = (PersistenceWeavedRest) result;
String href = HrefHelper.buildEntityHref(context, descriptor.getAlias(), IdHelper.stringifyId(result, descriptor.getAlias(), context));
itemLinks.addItem(new LinkV2(ReservedWords.JPARS_REL_SELF, href));
itemLinks.addItem(new LinkV2(ReservedWords.JPARS_REL_CANONICAL, href));
entity._persistence_setLinks(itemLinks);
return entity;
}
return result;