예제 #1
0
  @Override
  public Link createLink(String url) {
    Link link = new Link();
    link.setUrl(url);
    em.persist(link);

    Link newLink = addEncodeUrl(url);

    em.persist(newLink);
    return newLink;
  }
예제 #2
0
 private Link addEncodeUrl(String url) {
   Link link = findByName(url);
   link.setEncodeUrl(EncodeUrlHelper.encode(link.getId()));
   return link;
 }