コード例 #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;
 }