blob: 4783c9df99ac61e32a271ef62d178ace15cda530 [file] [log] [blame]
/*-
* ============LICENSE_START=======================================================
* OSAM Core
* ================================================================================
* Copyright (C) 2018 Netsia
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
*/
package org.onap.osam.model.dao;
import lombok.Getter;
import lombok.Setter;
import javax.persistence.*;
import java.util.Set;
/**
* Created by Zafer Kaban on 18.09.2018.
*/
@Entity
@Getter
@Setter
public class OLTPort extends BaseEntity {
@Enumerated(value = EnumType.STRING)
private ActivityState portAuthState;
@Enumerated(value = EnumType.STRING)
private AdminState adminState;
private Integer portNumber;
@ManyToOne
@JoinColumn(name="OLTSlot_id", nullable=false)
private OLTSlot oltSlot;
@OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, mappedBy = "OLTPort")
private Set<ONTDevice> ontDevices;
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("oltSlot{");
sb.append("id=").append(id);
sb.append(", portAuthState='").append(portAuthState).append('\'');
sb.append(", adminState='").append(adminState).append('\'');
sb.append(", portNumber=").append(portNumber);
sb.append('}');
return sb.toString();
}
}