/* * Copyright 2013 McEvoy Software Ltd. * * 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, either version 3 of the License, or * (at your option) any later version. * 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/>. */ package com.bandstand.domain; import java.util.Date; import java.util.List; import javax.persistence.*; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; /** * * @author brad */ @javax.persistence.Entity @Cache(usage = CacheConcurrencyStrategy.READ_WRITE) @Inheritance(strategy = InheritanceType.JOINED) @DiscriminatorColumn(name = "TYPE", discriminatorType = DiscriminatorType.STRING, length = 20) @DiscriminatorValue("E") public class BaseEntity { private long id; private String name; private String description; private Date createdDate; private Date modifiedDate; private List<Image> images; @Id @GeneratedValue public long getId() { return id; } public void setId(long id) { this.id = id; } @Column(nullable = false) @Temporal(javax.persistence.TemporalType.TIMESTAMP) public Date getCreatedDate() { return createdDate; } public void setCreatedDate(Date createdDate) { this.createdDate = createdDate; } @Column(nullable = false) @Temporal(javax.persistence.TemporalType.TIMESTAMP) public Date getModifiedDate() { return modifiedDate; } public void setModifiedDate(Date modifiedDate) { this.modifiedDate = modifiedDate; } @Column(nullable = false) public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } @OneToMany(mappedBy = "baseEntity") public List<Image> getImages() { return images; } public void setImages(List<Image> image) { this.images = image; } }