NotificationScheduleSubscriber.java

/*
 * Copyright 2024 Global Crop Diversity Trust
 *
 * 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.
 */

package org.gringlobal.model.notification;

import lombok.Getter;
import lombok.Setter;
import org.genesys.blocks.model.EmptyModel;
import org.genesys.blocks.security.model.AclSid;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "notification_schedule_subscriber")
@Getter
@Setter
public class NotificationScheduleSubscriber extends EmptyModel {

	private static final long serialVersionUID = -6845160104336573564L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "notification_schedule_subscriber_id", columnDefinition = "int")
	private Long id;

	@ManyToOne(fetch = FetchType.LAZY, cascade = {})
	@JoinColumn(name = "notification_id", nullable = false)
	private NotificationSchedule notificationSchedule;

	@ManyToOne(fetch = FetchType.LAZY, cascade = {})
	@JoinColumn(name = "sid_id", nullable = false)
	protected AclSid sid;

	@Override
	public boolean canEqual(Object other) {
		return other instanceof NotificationScheduleSubscriber;
	}

}