removed unused checklistupload
This commit is contained in:
parent
25fba0e5de
commit
b2726fc5d2
core/src/main/java/se/su/dsv/scipro/data/dataobjects
resources/db_update_scripts
@ -31,9 +31,6 @@ public class CheckList extends DomainObject {
|
||||
@ManyToOne(optional = false)
|
||||
private Project project;
|
||||
|
||||
@OneToOne(optional = true, orphanRemoval = true)
|
||||
private CheckListUpload checkListUpload;
|
||||
|
||||
@OneToMany(orphanRemoval = true)
|
||||
private List<CheckListQuestion> questions = new ArrayList<CheckListQuestion>();
|
||||
|
||||
@ -152,14 +149,6 @@ public class CheckList extends DomainObject {
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public CheckListUpload getCheckListUpload() {
|
||||
return checkListUpload;
|
||||
}
|
||||
|
||||
public void setCheckListUpload(CheckListUpload checkListUpload) {
|
||||
this.checkListUpload = checkListUpload;
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
return name;
|
||||
|
@ -1,138 +0,0 @@
|
||||
package se.su.dsv.scipro.data.dataobjects;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name="checklist_upload")
|
||||
public class CheckListUpload extends LazyDeletableDomainObject {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
public static final String DIRECTORY_PATH = "checklistuploads/";
|
||||
|
||||
@Id
|
||||
@GeneratedValue
|
||||
private Long id;
|
||||
|
||||
@OneToOne(optional=false)
|
||||
@JoinColumn(name="checklist_id")
|
||||
private CheckList checkList;
|
||||
|
||||
@ManyToOne(optional=true)
|
||||
private User handedInBy;
|
||||
|
||||
@Column(nullable=false)
|
||||
private String folderName;
|
||||
|
||||
@Column(nullable=false)
|
||||
private String fileName;
|
||||
|
||||
@OneToOne(orphanRemoval = true, cascade=CascadeType.REMOVE)
|
||||
private FileDescription file = new FileDescription();
|
||||
|
||||
public CheckListUpload(){}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int weight = 31;
|
||||
int result = 17;
|
||||
|
||||
result = weight * result + ((id == null) ? 0 : (int) (id ^ (id >>> 32)));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (this.getClass() != obj.getClass())
|
||||
return false;
|
||||
|
||||
CheckListUpload other = (CheckListUpload) obj;
|
||||
|
||||
if (id == null) {
|
||||
if (other.id != null)
|
||||
return false;
|
||||
} else if (!id.equals(other.id))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return String.valueOf(getId());
|
||||
}
|
||||
|
||||
private String getUniqueDirectoryName(String folderName){
|
||||
folderName = createFolderName(folderName);
|
||||
return folderName;
|
||||
}
|
||||
|
||||
private static String createFolderName(String str){
|
||||
str = str.trim();
|
||||
str = str.replaceAll(" ", "-");
|
||||
str = str.replaceAll("[^a-zA-Z0-9-_]", "-");
|
||||
str = str.replaceAll("(^[^A-Za-z0-9]+)|([^A-Za-z0-9]+$)", "");
|
||||
return str;
|
||||
}
|
||||
|
||||
public CheckList getCheckList() {
|
||||
return checkList;
|
||||
}
|
||||
|
||||
public void setCheckList(CheckList checkList) {
|
||||
this.checkList = checkList;
|
||||
folderName = checkList.getName();
|
||||
}
|
||||
|
||||
public User getHandedInBy() {
|
||||
return handedInBy;
|
||||
}
|
||||
|
||||
public void setHandedInBy(User handedInBy) {
|
||||
this.handedInBy = handedInBy;
|
||||
}
|
||||
|
||||
public String getFolderName() {
|
||||
return folderName;
|
||||
}
|
||||
|
||||
public String getDeleteFolderName(){
|
||||
return getUniqueDirectoryName(folderName);
|
||||
}
|
||||
|
||||
public void setFolderName(String folderName) {
|
||||
this.folderName = getUniqueDirectoryName(folderName);
|
||||
}
|
||||
|
||||
public FileDescription getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public void setFile(FileDescription file) {
|
||||
this.file = file;
|
||||
}
|
||||
|
||||
public String getFileName() {
|
||||
return fileName;
|
||||
}
|
||||
|
||||
public void setFileName(String fileName) {
|
||||
this.fileName = fileName;
|
||||
}
|
||||
|
||||
}
|
@ -47,4 +47,12 @@ ALTER TABLE `TurnitinSettings` ADD `lastFailedDate` datetime DEFAULT NULL;
|
||||
DELETE FROM web_notification;
|
||||
DROP TABLE web_notification;
|
||||
|
||||
DROP TABLE peer_queue;
|
||||
DROP TABLE peer_queue;
|
||||
|
||||
ALTER TABLE checklist DROP FOREIGN KEY FK17CCD1A65563395;
|
||||
ALTER TABLE checklist_upload DROP FOREIGN KEY FK6BCD32BA1F327355;
|
||||
|
||||
ALTER TABLE checklist DROP checkListUpload_id;
|
||||
ALTER TABLE checklist_upload DROP checklist_id;
|
||||
|
||||
DROP TABLE checklist_upload;
|
Loading…
x
Reference in New Issue
Block a user