PL-8275 Remove Creatable.LOGIN_FIELD_LEN constant

This commit is contained in:
Yuriy Artamonov 2016-11-28 17:36:58 +04:00
parent a469240885
commit 1beed3f95c
12 changed files with 26 additions and 31 deletions

View File

@ -41,13 +41,13 @@ public class Config extends BaseUuidEntity implements Versioned, Creatable, Upda
@Column(name = "CREATE_TS")
protected Date createTs;
@Column(name = "CREATED_BY", length = LOGIN_FIELD_LEN)
@Column(name = "CREATED_BY", length = 50)
protected String createdBy;
@Column(name = "UPDATE_TS")
private Date updateTs;
@Column(name = "UPDATED_BY", length = LOGIN_FIELD_LEN)
@Column(name = "UPDATED_BY", length = 50)
private String updatedBy;
@Column(name = "NAME")

View File

@ -22,9 +22,6 @@ import java.util.Date;
* Interface to be implemented by entities that contain information about who created them and when.
*/
public interface Creatable {
int LOGIN_FIELD_LEN = 50;
Date getCreateTs();
void setCreateTs(Date date);

View File

@ -34,7 +34,6 @@ import java.util.UUID;
/**
* Snapshot for entity.
*
*/
@Entity(name = "sys$EntitySnapshot")
@Table(name = "SYS_ENTITY_SNAPSHOT")
@ -46,7 +45,7 @@ public class EntitySnapshot extends BaseUuidEntity implements Creatable {
@Column(name = "CREATE_TS")
protected Date createTs;
@Column(name = "CREATED_BY", length = LOGIN_FIELD_LEN)
@Column(name = "CREATED_BY", length = 50)
protected String createdBy;
@Column(name = "VIEW_XML")

View File

@ -34,13 +34,13 @@ public class EntityStatistics extends BaseUuidEntity implements Creatable, Updat
@Column(name = "CREATE_TS")
protected Date createTs;
@Column(name = "CREATED_BY", length = LOGIN_FIELD_LEN)
@Column(name = "CREATED_BY", length = 50)
protected String createdBy;
@Column(name = "UPDATE_TS")
private Date updateTs;
@Column(name = "UPDATED_BY", length = LOGIN_FIELD_LEN)
@Column(name = "UPDATED_BY", length = 50)
private String updatedBy;
@Column(name = "NAME", length = 50)

View File

@ -34,7 +34,7 @@ public class FtsQueue extends BaseUuidEntity implements Creatable {
@Column(name = "CREATE_TS")
protected Date createTs;
@Column(name = "CREATED_BY", length = LOGIN_FIELD_LEN)
@Column(name = "CREATED_BY", length = 50)
protected String createdBy;
@Column(name = "ENTITY_ID")

View File

@ -37,7 +37,7 @@ public class JmxInstance extends StandardEntity {
@Column(name = "ADDRESS", length = 500, nullable = false)
protected String address;
@Column(name = "LOGIN", length = LOGIN_FIELD_LEN, nullable = false)
@Column(name = "LOGIN", length = 50, nullable = false)
protected String login;
@Column(name = "PASSWORD", length = 255)

View File

@ -57,7 +57,7 @@ public class ScheduledTask extends BaseUuidEntity implements Creatable, Updatabl
@Column(name = "CREATE_TS")
protected Date createTs;
@Column(name = "CREATED_BY", length = LOGIN_FIELD_LEN)
@Column(name = "CREATED_BY", length = 50)
protected String createdBy;
@Column(name = "UPDATE_TS")

View File

@ -35,13 +35,13 @@ public class Server extends BaseUuidEntity implements Creatable, Updatable {
@Column(name = "CREATE_TS")
protected Date createTs;
@Column(name = "CREATED_BY", length = LOGIN_FIELD_LEN)
@Column(name = "CREATED_BY", length = 50)
protected String createdBy;
@Column(name = "UPDATE_TS")
protected Date updateTs;
@Column(name = "UPDATED_BY", length = LOGIN_FIELD_LEN)
@Column(name = "UPDATED_BY", length = 50)
protected String updatedBy;
@Column(name = "NAME")

View File

@ -36,19 +36,19 @@ public class StandardEntity extends BaseUuidEntity implements Versioned, Creatab
@Column(name = "CREATE_TS")
protected Date createTs;
@Column(name = "CREATED_BY", length = LOGIN_FIELD_LEN)
@Column(name = "CREATED_BY", length = 50)
protected String createdBy;
@Column(name = "UPDATE_TS")
protected Date updateTs;
@Column(name = "UPDATED_BY", length = LOGIN_FIELD_LEN)
@Column(name = "UPDATED_BY", length = 50)
protected String updatedBy;
@Column(name = "DELETE_TS")
protected Date deleteTs;
@Column(name = "DELETED_BY", length = LOGIN_FIELD_LEN)
@Column(name = "DELETED_BY", length = 50)
protected String deletedBy;
@Override

View File

@ -37,7 +37,7 @@ public class Presentation extends BaseUuidEntity implements Creatable, Updatable
@Column(name = "CREATE_TS")
protected Date createTs;
@Column(name = "CREATED_BY", length = LOGIN_FIELD_LEN)
@Column(name = "CREATED_BY", length = 50)
protected String createdBy;
@Column(name = "COMPONENT")
@ -59,7 +59,7 @@ public class Presentation extends BaseUuidEntity implements Creatable, Updatable
@Column(name = "UPDATE_TS")
protected Date updateTs;
@Column(name = "UPDATED_BY", length = LOGIN_FIELD_LEN)
@Column(name = "UPDATED_BY", length = 50)
protected String updatedBy;
@Transient

View File

@ -32,7 +32,6 @@ import java.util.UUID;
/**
* Screen history item.
*
*/
@Entity(name = "sec$ScreenHistory")
@Table(name = "SEC_SCREEN_HISTORY")
@ -41,17 +40,10 @@ public class ScreenHistoryEntity extends BaseUuidEntity implements Creatable {
private static final long serialVersionUID = 1L;
@PostConstruct
protected void init() {
UserSession userSession = AppBeans.get(UserSessionSource.class).getUserSession();
setUser(userSession.getUser());
setSubstitutedUser(userSession.getSubstitutedUser());
}
@Column(name = "CREATE_TS")
protected Date createTs;
@Column(name = "CREATED_BY", length = LOGIN_FIELD_LEN)
@Column(name = "CREATED_BY", length = 50)
protected String createdBy;
@ManyToOne(fetch = FetchType.LAZY)
@ -136,4 +128,11 @@ public class ScreenHistoryEntity extends BaseUuidEntity implements Creatable {
UserFormatTools formatTools = AppBeans.get(UserFormatTools.NAME);
return formatTools.formatUser(user, substitutedUser);
}
}
@PostConstruct
protected void init() {
UserSession userSession = AppBeans.get(UserSessionSource.class).getUserSession();
setUser(userSession.getUser());
setSubstitutedUser(userSession.getSubstitutedUser());
}
}

View File

@ -41,11 +41,11 @@ public class User extends StandardEntity {
private static final long serialVersionUID = 5007187642916030394L;
@Column(name = "LOGIN", length = LOGIN_FIELD_LEN, nullable = false)
@Column(name = "LOGIN", length = 50, nullable = false)
protected String login;
@SystemLevel
@Column(name = "LOGIN_LC", length = LOGIN_FIELD_LEN, nullable = false)
@Column(name = "LOGIN_LC", length = 50, nullable = false)
protected String loginLowerCase;
@SystemLevel