Package fr.openwide.core.jpa.more.business.link.model

Examples of fr.openwide.core.jpa.more.business.link.model.ExternalLinkWrapper


    }

    @Override
    public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
      if (StringUtils.hasText((String) source)) {
        return new ExternalLinkWrapper((String) source);
      }
      return null;
    }
View Full Code Here


    Injector.get().inject(this);
  }
 
  @Override
  public String getObject() {
    ExternalLinkWrapper link = wrappedModel.getObject();
    return link != null ? link.getUrl() : null;
  }
View Full Code Here

  }
 
  @Override
  public void setObject(String url) {
    if (url != null && wrappedModel.getObject() == null) {
      wrappedModel.setObject(new ExternalLinkWrapper(url));
    } else if (url != null) {
      wrappedModel.getObject().setUrl(url);
    } else {
      // NOTE: This is a workaround to the orphanRemoval bug on one-to-one relationship
      // https://hibernate.atlassian.net/browse/HHH-5559
      // https://hibernate.atlassian.net/browse/HHH-6484
      ExternalLinkWrapper link = wrappedModel.getObject();
      wrappedModel.setObject(null);
      if (link != null) {
        try {
          externalLinkWrapperService.delete(link);
        } catch (Exception e) {
          LOGGER.error("An error occurred while deleting the link " + link.getUrl());
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of fr.openwide.core.jpa.more.business.link.model.ExternalLinkWrapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.