Renames DMP and Dataset columns.

This commit is contained in:
gkolokythas 2019-06-24 17:01:24 +03:00
parent 742dd5015f
commit b8977669c6
4 changed files with 28 additions and 21 deletions

View File

@ -156,16 +156,16 @@ public class DMP implements DataEntity<DMP, UUID> {
@Column(name = "\"Description\"") @Column(name = "\"Description\"")
private String description; private String description;
@Column(name= "\"FinalizedDat\"") @Column(name= "\"FinalizedAt\"")
@Convert(converter = DateToUTCConverter.class) @Convert(converter = DateToUTCConverter.class)
private Date finalizedDat; private Date finalizedAt;
@Column(name = "\"isPublic\"", nullable = false) @Column(name = "\"isPublic\"", nullable = false)
private boolean isPublic; private boolean isPublic;
@Column(name= "\"PublishedDat\"") @Column(name= "\"PublishedAt\"")
@Convert(converter = DateToUTCConverter.class) @Convert(converter = DateToUTCConverter.class)
private Date publishedDat; private Date publishedAt;
public String getDescription() { public String getDescription() {
@ -294,11 +294,11 @@ public class DMP implements DataEntity<DMP, UUID> {
this.dmpProperties = dmpProperties; this.dmpProperties = dmpProperties;
} }
public Date getFinalizedDat() { public Date getFinalizedAt() {
return finalizedDat; return finalizedAt;
} }
public void setFinalizedDat(Date finalizedDat) { public void setFinalizedAt(Date finalizedAt) {
this.finalizedDat = finalizedDat; this.finalizedAt = finalizedAt;
} }
public boolean isPublic() { public boolean isPublic() {
@ -308,11 +308,11 @@ public class DMP implements DataEntity<DMP, UUID> {
isPublic = aPublic; isPublic = aPublic;
} }
public Date getPublishedDat() { public Date getPublishedAt() {
return publishedDat; return publishedAt;
} }
public void setPublishedDat(Date publishedDat) { public void setPublishedAt(Date publishedAt) {
this.publishedDat = publishedDat; this.publishedAt = publishedAt;
} }
@Override @Override
@ -330,8 +330,8 @@ public class DMP implements DataEntity<DMP, UUID> {
this.dmpProperties = entity.getDmpProperties(); this.dmpProperties = entity.getDmpProperties();
this.isPublic = entity.isPublic; this.isPublic = entity.isPublic;
this.setModified(new Date()); this.setModified(new Date());
if (entity.getStatus().equals(DMPStatus.FINALISED.getValue())) this.setFinalizedDat(new Date()); if (entity.getStatus().equals(DMPStatus.FINALISED.getValue())) this.setFinalizedAt(new Date());
if (entity.isPublic) this.setPublishedDat(new Date()); if (entity.isPublic) this.setPublishedAt(new Date());
if (entity.getUsers() != null) this.users = entity.getUsers(); if (entity.getUsers() != null) this.users = entity.getUsers();
} }

View File

@ -140,9 +140,9 @@ public class Dataset implements DataEntity<Dataset, UUID> {
@Column(name = "\"Description\"") @Column(name = "\"Description\"")
private String description; private String description;
@Column(name= "\"FinalizedDat\"") @Column(name= "\"FinalizedAt\"")
@Convert(converter = DateToUTCConverter.class) @Convert(converter = DateToUTCConverter.class)
private Date finalizedDat; private Date finalizedAt;
public String getDescription() { public String getDescription() {
@ -267,11 +267,11 @@ public class Dataset implements DataEntity<Dataset, UUID> {
this.datasetExternalDatasets = datasetExternalDatasets; this.datasetExternalDatasets = datasetExternalDatasets;
} }
public Date getFinalizedDat() { public Date getFinalizedAt() {
return finalizedDat; return finalizedAt;
} }
public void setFinalizedDat(Date finalizedDat) { public void setFinalizedAt(Date finalizedAt) {
this.finalizedDat = finalizedDat; this.finalizedAt = finalizedAt;
} }
@Override @Override
@ -300,7 +300,7 @@ public class Dataset implements DataEntity<Dataset, UUID> {
this.setStatus(entity.getStatus()); this.setStatus(entity.getStatus());
this.setProfile(entity.getProfile()); this.setProfile(entity.getProfile());
this.setModified(new Date()); this.setModified(new Date());
if (entity.getStatus().equals(Status.FINALISED.getValue())) this.setFinalizedDat(new Date()); if (entity.getStatus().equals(Status.FINALISED.getValue())) this.setFinalizedAt(new Date());
if (entity.getCreator() != null) this.creator = entity.getCreator(); if (entity.getCreator() != null) this.creator = entity.getCreator();
} }

View File

@ -0,0 +1,5 @@
ALTER TABLE public."DMP"
RENAME COLUMN "FinalizedDat" TO "FinalizedAt";
ALTER TABLE public."DMP"
RENAME COLUMN "PublishedDat" TO "PublishedAt";

View File

@ -0,0 +1,2 @@
ALTER TABLE public."Dataset"
RENAME COLUMN "FinalizedDat" TO "FinalizedAt";