@@ -0,0 +1,2015 @@
+/*%0A *%0A *  * Copyright (c) 2016 Fraunhofer FOKUS%0A *  *%0A *  * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A *  * you may not use this file except in compliance with the License.%0A *  * You may obtain a copy of the License at%0A *  *%0A *  *     http://www.apache.org/licenses/LICENSE-2.0%0A *  *%0A *  * Unless required by applicable law or agreed to in writing, software%0A *  * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A *  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A *  * See the License for the specific language governing permissions and%0A *  * limitations under the License.%0A *%0A *%0A */%0A%0Apackage org.openbaton.catalogue.security;%0A%0Aimport org.openbaton.catalogue.util.IdGenerator;%0A%0Aimport javax.persistence.*;%0Aimport java.io.Serializable;%0A%0A/**%0A * Created by mpa on 09.08.16.%0A */%0A@Entity%0A@Table(%0A  name = %22PublicKeys%22,%0A  uniqueConstraints = @UniqueConstraint(columnNames = %7B%22name%22, %22projectId%22%7D)%0A)%0Apublic class Key implements Serializable %7B%0A%0A  @Id private String id;%0A%0A  private String name;%0A%0A  private String projectId;%0A%0A  private String publicKey;%0A%0A  public String getId() %7B%0A    return id;%0A  %7D%0A%0A  public Key() %7B%7D%0A%0A  public void setId(String id) %7B%0A    this.id = id;%0A  %7D%0A%0A  @PrePersist%0A  public void ensureId() %7B%0A    id = IdGenerator.createUUID();%0A  %7D%0A%0A  public String getName() %7B%0A    return name;%0A  %7D%0A%0A  public void setName(String name) %7B%0A    this.name = name;%0A  %7D%0A%0A  public String getPublicKey() %7B%0A    return publicKey;%0A  %7D%0A%0A  public void setPublicKey(String publicKey) %7B%0A    this.publicKey = publicKey;%0A  %7D%0A%0A  public String getProjectId() %7B%0A    return projectId;%0A  %7D%0A%0A  public void setProjectId(String projectId) %7B%0A    this.projectId = projectId;%0A  %7D%0A%0A  @Override%0A  public String toString() %7B%0A    return %22Key%7B%22%0A        + %22id='%22%0A        + id%0A        + '%5C''%0A        + %22, name='%22%0A        + name%0A        + '%5C''%0A        + %22, projectId='%22%0A        + projectId%0A        + '%5C''%0A        + %22, publicKey='%22%0A        + publicKey%0A        + '%5C''%0A        + '%7D';%0A  %7D%0A%7D%0A

Add key entity