@@ -0,0 +1,1021 @@
+package com.huixinpn.dionysus.utils;%0A%0Aimport com.huixinpn.dionysus.domain.AbstractDionysusPersistable;%0Aimport org.springframework.beans.factory.annotation.Autowired;%0Aimport org.springframework.data.domain.Pageable;%0Aimport org.springframework.data.rest.webmvc.support.RepositoryEntityLinks;%0Aimport org.springframework.hateoas.Link;%0Aimport org.springframework.stereotype.Service;%0A%0A//used for sometime you need programmatically get entity instance link%0A@Service%0Apublic class LinkHelper %7B%0A%0A  private RepositoryEntityLinks links;%0A%0A  @Autowired%0A  public void setLinks(RepositoryEntityLinks links) %7B%0A    this.links = links;%0A  %7D%0A%0A  public Link getEntityLink(AbstractDionysusPersistable entity) %7B%0A    return links.linkToSingleResource(entity.getClass(), entity.getId());%0A  %7D%0A%0A  public Link getRepositoryLink(Class%3C?%3E entityKlass) %7B%0A    return links.linkToCollectionResource(entityKlass);%0A  %7D%0A%0A  public Link getPagedLink(Class%3C?%3E entityKlass, Pageable pageable) %7B%0A    return links.linkToPagedResource(entityKlass, pageable);%0A  %7D%0A%7D%0A

add Enity2Link help utitlity