FileResource
git-svn-id: svn://svn.dsv.su.se/scipro/scipro/trunk@312 73ecded7-942e-4092-bab0-0e58ef0ee984
This commit is contained in:
parent
c8b44cd774
commit
c92d18fd39
src/main
java/se/su/dsv/scipro/data
dao
dataobjects
resources/META-INF
@ -0,0 +1,11 @@
|
||||
package se.su.dsv.scipro.data.dao.interfaces;
|
||||
|
||||
import se.su.dsv.scipro.data.dataobjects.FileResource;
|
||||
|
||||
/**
|
||||
* @author Martin Peters - mpeters@dsv.su.se
|
||||
*
|
||||
*/
|
||||
public interface FileResourceDao extends Dao<FileResource>{
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package se.su.dsv.scipro.data.dao.jpa;
|
||||
|
||||
import se.su.dsv.scipro.data.dao.interfaces.FileResourceDao;
|
||||
import se.su.dsv.scipro.data.dataobjects.FileResource;
|
||||
|
||||
/**
|
||||
* @author Martin Peters - mpeters@dsv.su.se
|
||||
*
|
||||
*/
|
||||
public class FileResourceDaoJPAImp extends AbstractDaoJPAImp<FileResource> implements FileResourceDao{
|
||||
|
||||
public FileResourceDaoJPAImp() {
|
||||
super(FileResource.class);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package se.su.dsv.scipro.data.dataobjects;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Cacheable;
|
||||
import javax.persistence.CascadeType;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.OrderColumn;
|
||||
|
||||
import org.hibernate.annotations.Cache;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
|
||||
/**
|
||||
* @author Martin Peters - mpeters@dsv.su.se
|
||||
*
|
||||
*/
|
||||
@Entity
|
||||
@Cacheable(true)
|
||||
@Cache(usage= CacheConcurrencyStrategy.NONSTRICT_READ_WRITE) //Hibernate specific
|
||||
public class FileResource extends Resource {
|
||||
|
||||
private static final long serialVersionUID = -1463752050169274998L;
|
||||
|
||||
@OrderColumn
|
||||
@OneToMany(cascade=CascadeType.ALL, orphanRemoval=true)
|
||||
private List<FileDescription> fileList = new ArrayList<FileDescription>();
|
||||
|
||||
/**
|
||||
* @param fileList the fileList to set
|
||||
*/
|
||||
public void setFileList(List<FileDescription> fileList) {
|
||||
this.fileList = fileList;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the fileList
|
||||
*/
|
||||
public List<FileDescription> getFileList() {
|
||||
return fileList;
|
||||
}
|
||||
|
||||
}
|
@ -18,7 +18,6 @@ import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
@Entity
|
||||
@Cacheable(true)
|
||||
@Cache(usage= CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
|
||||
@Table(name="link")
|
||||
public class Link extends Resource {
|
||||
|
||||
@Lob
|
||||
|
@ -3,29 +3,20 @@ package se.su.dsv.scipro.data.dataobjects;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.persistence.Cacheable;
|
||||
import javax.persistence.DiscriminatorColumn;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.JoinTable;
|
||||
import javax.persistence.Lob;
|
||||
import javax.persistence.ManyToMany;
|
||||
import javax.persistence.OneToMany;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import org.hibernate.annotations.Cache;
|
||||
import org.hibernate.annotations.CacheConcurrencyStrategy;
|
||||
import javax.persistence.MappedSuperclass;
|
||||
|
||||
/**
|
||||
* @author Johan Aschan - aschan@se.su.dsv
|
||||
*
|
||||
*/
|
||||
@Entity
|
||||
@Cacheable(true)
|
||||
@Cache(usage= CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
|
||||
@DiscriminatorColumn(name = "resourceType")
|
||||
@Table(name="resource")
|
||||
//@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
|
||||
public class Resource extends Ratable {
|
||||
@MappedSuperclass
|
||||
public abstract class Resource extends Ratable {
|
||||
|
||||
@Lob
|
||||
private String heading;
|
||||
|
||||
@Lob
|
||||
private String info;
|
||||
@ -34,6 +25,13 @@ public class Resource extends Ratable {
|
||||
@JoinTable(name="resource_tag")
|
||||
private List<Tag> tagList = new ArrayList<Tag>();
|
||||
|
||||
public void setHeading(String heading) {
|
||||
this.heading = heading;
|
||||
}
|
||||
|
||||
public String getHeading() {
|
||||
return heading;
|
||||
}
|
||||
|
||||
public String getInfo() {
|
||||
return info;
|
||||
|
@ -45,6 +45,7 @@
|
||||
<class>se.su.dsv.scipro.data.dataobjects.Comment</class>
|
||||
<class>se.su.dsv.scipro.data.dataobjects.ProjectClass</class>
|
||||
<class>se.su.dsv.scipro.data.dataobjects.FileDescription</class>
|
||||
<class>se.su.dsv.scipro.data.dataobjects.FileResource</class>
|
||||
<class>se.su.dsv.scipro.peer.data.dataobjects.Answer</class>
|
||||
<class>se.su.dsv.scipro.peer.data.dataobjects.PeerQueue</class>
|
||||
<class>se.su.dsv.scipro.peer.data.dataobjects.PeerReview</class>
|
||||
@ -128,6 +129,7 @@
|
||||
<class>se.su.dsv.scipro.data.dataobjects.Comment</class>
|
||||
<class>se.su.dsv.scipro.data.dataobjects.ProjectClass</class>
|
||||
<class>se.su.dsv.scipro.data.dataobjects.FileDescription</class>
|
||||
<class>se.su.dsv.scipro.data.dataobjects.FileResource</class>
|
||||
<class>se.su.dsv.scipro.peer.data.dataobjects.Answer</class>
|
||||
<class>se.su.dsv.scipro.peer.data.dataobjects.PeerQueue</class>
|
||||
<class>se.su.dsv.scipro.peer.data.dataobjects.PeerReview</class>
|
||||
|
Loading…
x
Reference in New Issue
Block a user