Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,12 @@ public class AdminUnit extends BaseEntity implements Serializable {

@NotNull
@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(style = "M-")
@DateTimeFormat(pattern="d.MM.yyyy")
private Date fromDate;

@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(style = "M-")
@DateTimeFormat(pattern="d.MM.yyyy")
private Date untilDate;

private String changedBy;

@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(style = "M-")
private Date changedDate;

private String closedBy;

@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(style = "M-")
private Date closedDate = GeneralFunctions.notDeleted;

public Date getClosedDate() {
return closedDate;
}

public void setClosedDate(Date closedDate) {
this.closedDate = closedDate;
}


@OneToMany(mappedBy = "adminUnit")
private Collection<Regiment> regiments;
Expand Down Expand Up @@ -127,31 +106,6 @@ public void setUntilDate(Date untilDate) {
this.untilDate = untilDate;
}


public String getChangedBy() {
return changedBy;
}

public void setChangedBy(String changedBy) {
this.changedBy = changedBy;
}

protected Date getChangedDate() {
return changedDate;
}

public void setChangedDate(Date changedDate) {
this.changedDate = changedDate;
}

public String getClosedBy() {
return closedBy;
}

public void setClosedBy(String closedBy) {
this.closedBy = closedBy;
}

public Collection<Regiment> getRegiments() {
return regiments;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,32 +35,12 @@ public class AdminUnitHierarchy extends BaseEntity implements Serializable {

@NotNull
@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(style = "M-")
@DateTimeFormat(pattern="d.MM.yyyy")
private Date fromDate;

@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(style = "M-")
@DateTimeFormat(pattern="d.MM.yyyy")
private Date untilDate;

private String changedBy;

@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(style = "M-")
private Date changedDate;

private String closedBy;

@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(style = "M-")
private Date closedDate = GeneralFunctions.notDeleted;

public Date getClosedDate() {
return closedDate;
}

public void setClosedDate(Date closedDate) {
this.closedDate = closedDate;
}

@ManyToOne
private AdminUnit adminUnit;
Expand Down Expand Up @@ -91,30 +71,6 @@ public Date getUntilDate() {
public void setUntilDate(Date untilDate) {
this.untilDate = untilDate;
}

public String getChangedBy() {
return changedBy;
}

public void setChangedBy(String changedBy) {
this.changedBy = changedBy;
}

public Date getChangedDate() {
return changedDate;
}

public void setChangedDate(Date changedDate) {
this.changedDate = changedDate;
}

public String getClosedBy() {
return closedBy;
}

public void setClosedBy(String closedBy) {
this.closedBy = closedBy;
}

public AdminUnit getAdminUnit() {
return adminUnit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,33 +46,12 @@ public class AdminUnitType extends BaseEntity implements Serializable {

@NotNull
@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(style = "M-")
@DateTimeFormat(pattern="d.MM.yyyy")
private Date fromDate;

@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(style = "M-")
@DateTimeFormat(pattern="d.MM.yyyy")
private Date untilDate;

private String changedBy;

@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(style = "M-")
private Date changedDate;

private String closedBy;

@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(style = "M-")
private Date closedDate = GeneralFunctions.notDeleted;

public Date getClosedDate() {
return closedDate;
}

public void setClosedDate(Date closedDate) {
this.closedDate = closedDate;
}


@OneToMany(mappedBy = "adminUnitType")
private Collection<AdminUnit> adminUnits;
Expand Down Expand Up @@ -124,31 +103,6 @@ public void setUntilDate(Date untilDate) {
this.untilDate = untilDate;
}

public String getChangedBy() {
return changedBy;
}

public void setChangedBy(String changedBy) {
this.changedBy = changedBy;
}

public Date getChangedDate() {
return changedDate;
}

public void setChangedDate(Date changedDate) {
this.changedDate = changedDate;
}

public String getClosedBy() {
return closedBy;
}

public void setClosedBy(String closedBy) {
this.closedBy = closedBy;
}


public Collection<AdminUnit> getAdminUnits() {
return adminUnits;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,6 @@ public class AdminUnitTypeHierarchy extends BaseEntity implements Serializable {
@NotNull
private String comment;

private String changedBy;

@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(style = "M-")
private Date changedDate;

private String closedBy;

@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(style = "M-")
private Date closedDate = GeneralFunctions.notDeleted;

public Date getClosedDate() {
return closedDate;
}

public void setClosedDate(Date closedDate) {
this.closedDate = closedDate;
}

@ManyToOne
private AdminUnitType adminUnitType;

Expand All @@ -66,30 +46,6 @@ public void setComment(String comment) {
this.comment = comment;
}

public String getChangedBy() {
return changedBy;
}

public void setChangedBy(String changedBy) {
this.changedBy = changedBy;
}

public Date getChangedDate() {
return changedDate;
}

public void setChangedDate(Date changedDate) {
this.changedDate = changedDate;
}

public String getClosedBy() {
return closedBy;
}

public void setClosedBy(String closedBy) {
this.closedBy = closedBy;
}

public AdminUnitType getAdminUnitType() {
return adminUnitType;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ privileged aspect AdminUnit_Roo_ToString {
sb.append("AdminUnitHierarchys: ").append(getAdminUnitHierarchys() == null ? "null" : getAdminUnitHierarchys().size()).append(", ");
sb.append("AdminUnitType: ").append(getAdminUnitType()).append(", ");
sb.append("ChangedBy: ").append(getChangedBy()).append(", ");
sb.append("ChangedDate: ").append(getChangedDate()).append(", ");
sb.append("ClosedBy: ").append(getClosedBy()).append(", ");
sb.append("ClosedDate: ").append(getClosedDate()).append(", ");
sb.append("Code: ").append(getCode()).append(", ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,27 @@
//public class BaseEntity {
public abstract class BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;

private String openedBy;

@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(style = "M-")
@DateTimeFormat(pattern="d.MM.yyyy")
private Date openedDate = getDateTime();


private String changedBy;

@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(pattern="d.MM.yyyy")
private Date changedDate;

private String closedBy;

@Temporal(TemporalType.TIMESTAMP)
@DateTimeFormat(pattern="d.MM.yyyy")
private Date closedDate = GeneralFunctions.notDeleted;

// getter & setter - ei muuda!

Expand All @@ -51,7 +61,37 @@ public Date getOpenedDate() {
public void setOpenedDate(Date openedDate) {
this.openedDate = openedDate;
}
public String getChangedBy() {
return changedBy;
}

public void setChangedBy(String changedBy) {
this.changedBy = changedBy;
}

public Date getChangedDate() {
return changedDate;
}

public void setChangedDate(Date changedDate) {
this.changedDate = changedDate;
}

public String getClosedBy() {
return closedBy;
}

public void setClosedBy(String closedBy) {
this.closedBy = closedBy;
}

public Date getClosedDate() {
return closedDate;
}

public void setClosedDate(Date closedDate) {
this.closedDate = closedDate;
}
@PrePersist
public void setCreated() {
String currentUser = SecurityContextHolder.getContext().getAuthentication().getName();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ privileged aspect BaseEntity_Roo_ToString {

public String BaseEntity.toString() {
StringBuilder sb = new StringBuilder();
sb.append("ChangedBy: ").append(getChangedBy()).append(", ");
sb.append("ChangedDate: ").append(getChangedDate()).append(", ");
sb.append("ClosedBy: ").append(getClosedBy()).append(", ");
sb.append("ClosedDate: ").append(getClosedDate()).append(", ");
sb.append("DateTime: ").append(getDateTime()).append(", ");
sb.append("Id: ").append(getId()).append(", ");
sb.append("OpenedBy: ").append(getOpenedBy()).append(", ");
Expand Down
Loading