@@ -0,0 +1,2939 @@
+/*%0A * Copyright (C) 2000 - 2015 Silverpeas%0A *%0A * This program is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU Affero General Public License as%0A * published by the Free Software Foundation, either version 3 of the%0A * License, or (at your option) any later version.%0A *%0A * As a special exception to the terms and conditions of version 3.0 of%0A * the GPL, you may redistribute this Program in connection with Free/Libre%0A * Open Source Software (%22FLOSS%22) applications as described in Silverpeas's%0A * FLOSS exception. You should have received a copy of the text describing%0A * the FLOSS exception, and it is also available here:%0A * %22https://www.silverpeas.org/legal/floss_exception.html%22%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the%0A * GNU Affero General Public License for more details.%0A *%0A * You should have received a copy of the GNU Affero General Public License%0A * along with this program. If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0Apackage org.silverpeas.persistence.model.identifier;%0A%0Aimport org.apache.commons.lang3.builder.EqualsBuilder;%0Aimport org.apache.commons.lang3.builder.HashCodeBuilder;%0Aimport org.silverpeas.persistence.model.ExternalEntityIdentifier;%0A%0Aimport javax.persistence.Column;%0Aimport javax.persistence.Embeddable;%0Aimport java.util.Collection;%0Aimport java.util.List;%0Aimport java.util.stream.Collectors;%0A%0A/**%0A * This external entity identifier implementation handles external integer identifier.%0A * @author ebonnet%0A */%0A@Embeddable%0Apublic class ExternalIntegerIdentifier implements ExternalEntityIdentifier %7B%0A%0A  @Column(name = %22id%22)%0A  private Integer id;%0A%0A  public static ExternalIntegerIdentifier from(String value) %7B%0A    return new ExternalIntegerIdentifier().fromString(value);%0A  %7D%0A%0A  public static List%3CExternalIntegerIdentifier%3E fromStrings(Collection%3CString%3E values) %7B%0A    return values.stream().map(ExternalIntegerIdentifier::from).collect(Collectors.toList());%0A  %7D%0A%0A  @Override%0A  public ExternalIntegerIdentifier fromString(final String id) %7B%0A    return setId(Integer.valueOf(id));%0A  %7D%0A%0A  @Override%0A  public String asString() %7B%0A    return getId().toString();%0A  %7D%0A%0A  public Integer getId() %7B%0A    return id;%0A  %7D%0A%0A  public ExternalIntegerIdentifier setId(final Integer id) %7B%0A    this.id = id;%0A    return this;%0A  %7D%0A%0A  @Override%0A  public int hashCode() %7B%0A    return new HashCodeBuilder().append(getId()).toHashCode();%0A  %7D%0A%0A  @Override%0A  public boolean equals(final Object obj) %7B%0A    if (obj == null) %7B%0A      return false;%0A    %7D%0A    if (getClass() != obj.getClass()) %7B%0A      return false;%0A    %7D%0A    final ExternalStringIdentifier other = (ExternalStringIdentifier) obj;%0A    return new EqualsBuilder().append(getId(), other.getId()).isEquals();%0A  %7D%0A%0A  @Override%0A  public String toString() %7B%0A    return asString();%0A  %7D%0A%0A%7D%0A

add new EntityIdentifier for delegatednews application purpose