/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.apache.hise.dao; import java.util.Date; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.Temporal; @Entity @Table(name = "ATTACHMENT") public class Attachment extends JpaBase { @Id @GeneratedValue private Long id; @Column private String attachment; @Column private String name; @Column private String accessType; @Column private String contentType; @Column @Temporal(javax.persistence.TemporalType.TIMESTAMP) private Date attachedAt; @Column private long userId; @ManyToOne @JoinColumn(name = "TASK_ID") private Task task; public void setName(String name) { this.name = name; } public String getName() { return this.name; } public String getAccessType() { return this.accessType; } public void setAccessType(String accessType) { this.accessType = accessType; } public String getContentType() { return this.contentType; } public void setContentType(String contentType) { this.contentType = contentType; } public Date getAttachedAt() { return (this.attachedAt == null) ? null : (Date) this.attachedAt.clone(); } public void setAttachedAt(Date attachedAt) { this.attachedAt = (attachedAt == null) ? null : (Date) attachedAt.clone(); } public long getUserId() { return this.userId; } public void setUserId(long userId) { this.userId = userId; } public String getAttachment() { return this.attachment; } public void setAttachment(String attachment) { this.attachment = attachment; } public Task getTask() { return this.task; } public void setTask(Task task) { this.task = task; } @Override public Object[] getKeys() { return new Object[] { id, name }; } }