/*************************************************************************
* (c) Copyright 2016 Hewlett Packard Enterprise Development Company LP
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see http://www.gnu.org/licenses/.
*
* This file may incorporate work covered under the following copyright and permission notice:
*
* Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file 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 com.eucalyptus.simplequeue.persistence.postgresql;
import com.eucalyptus.entities.AbstractPersistent;
import org.hibernate.annotations.Type;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.PersistenceContext;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;
/**
* Created by ethomas on 9/7/16.
*/
@Entity
@PersistenceContext( name = "eucalyptus_simplequeue" )
@Table( name = "queues", uniqueConstraints = @UniqueConstraint(columnNames = {"account_id", "queue_name"},
name = "queues_composite_key") )
public class QueueEntity extends AbstractPersistent {
@Column(name = "account_id", nullable = false)
String accountId;
@Column(name = "queue_name", nullable = false)
String queueName;
@Column(name = "partition_token", nullable = false)
String partitionToken;
@Column(name = "attributes_json", nullable = false)
@Lob
@Type(type="org.hibernate.type.StringClobType")
String attributes;
@Column(name = "last_lookup_timestamp", nullable = false)
Long lastLookupTimestampSecs;
public QueueEntity() {
}
public String getAccountId() {
return accountId;
}
public void setAccountId(String accountId) {
this.accountId = accountId;
}
public String getAttributes() {
return attributes;
}
public void setAttributes(String attributes) {
this.attributes = attributes;
}
public String getQueueName() {
return queueName;
}
public void setQueueName(String queueName) {
this.queueName = queueName;
}
public Long getLastLookupTimestampSecs() {
return lastLookupTimestampSecs;
}
public void setLastLookupTimestampSecs(Long lastLookupTimestampSecs) {
this.lastLookupTimestampSecs = lastLookupTimestampSecs;
}
public String getPartitionToken() {
return partitionToken;
}
public void setPartitionToken(String partitionToken) {
this.partitionToken = partitionToken;
}
}