@org.springframework.data.annotation.CreatedBy

Here are the examples of the java api @org.springframework.data.annotation.CreatedBy taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

94 Examples 7

19 Source : Auditable.java
with MIT License
from Robinyo

@Embeddable
public clreplaced Auditable {

    @CreatedBy
    private String createdBy;

    @CreatedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdAt;

    @LastModifiedBy
    private String updatedBy;

    @LastModifiedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date updatedAt;
}

19 Source : BaseAuditableEntity.java
with Apache License 2.0
from idugalic

@Doreplacedent
@SuppressWarnings("serial")
public abstract clreplaced BaseAuditableEnreplacedy extends BaseEnreplacedy {

    @CreatedBy
    private String createdBy;

    @CreatedDate
    private Date createdTime;

    @LastModifiedBy
    private String lastModifiedBy;

    @LastModifiedDate
    private Date lastModifiedTime;

    public String getCreatedBy() {
        return createdBy;
    }

    public Date getCreatedTime() {
        return createdTime;
    }

    public String getLastModifiedBy() {
        return lastModifiedBy;
    }

    public Date getLastModifiedTime() {
        return lastModifiedTime;
    }
}

19 Source : Folder.java
with MIT License
from hmcts

@Enreplacedy
@Builder
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public clreplaced Folder implements CreatorAware {

    @Id
    @GeneratedValue(generator = "uuid2")
    @GenericGenerator(name = "uuid2", strategy = "uuid2")
    @Getter
    @Setter
    private UUID id;

    @Getter
    @Setter
    private String name;

    @OneToMany(mappedBy = "folder")
    @OrderColumn(name = "ds_idx")
    @Getter
    @Setter
    private List<StoredDoreplacedent> storedDoreplacedents;

    @Getter
    @Setter
    @CreatedBy
    private String createdBy;

    @Getter
    @Setter
    @LastModifiedBy
    private String lastModifiedBy;

    @LastModifiedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date modifiedOn;

    @CreatedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdOn;

    public Folder(UUID id, String name, List<StoredDoreplacedent> storedDoreplacedents, String createdBy, String lastModifiedBy, Date modifiedOn, Date createdOn) {
        this.id = id;
        this.name = name;
        this.storedDoreplacedents = storedDoreplacedents;
        this.createdBy = createdBy;
        this.lastModifiedBy = lastModifiedBy;
        setModifiedOn(modifiedOn);
        setCreatedOn(createdOn);
    }

    public Folder() {
        storedDoreplacedents = new ArrayList<>();
    }

    public Date getModifiedOn() {
        return (modifiedOn == null) ? null : new Date(modifiedOn.getTime());
    }

    public void setModifiedOn(Date modifiedOn) {
        this.modifiedOn = (modifiedOn == null) ? null : new Date(modifiedOn.getTime());
    }

    public Date getCreatedOn() {
        return (createdOn == null) ? null : new Date(createdOn.getTime());
    }

    public void setCreatedOn(Date createdOn) {
        this.createdOn = (createdOn == null) ? null : new Date(createdOn.getTime());
    }

    public static clreplaced FolderBuilder {

        public Folder.FolderBuilder modifiedOn(Date modifiedOn) {
            this.modifiedOn = (modifiedOn == null) ? null : new Date(modifiedOn.getTime());
            return this;
        }

        public Folder.FolderBuilder createdOn(Date createdOn) {
            this.createdOn = (createdOn == null) ? null : new Date(createdOn.getTime());
            return this;
        }
    }
}

18 Source : Party.java
with MIT License
from Robinyo

@Enreplacedy
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Setter
@Getter
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public clreplaced Party {

    // When using Hibernate, the IDENreplacedY generator is not a good choice since it disables JDBC batching.
    // See: https://vladmihalcea.com/14-high-performance-java-persistence-tips/
    // https://vladmihalcea.com/jpa-enreplacedy-identifier-sequence/
    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SequenceParty")
    @SequenceGenerator(name = "SequenceParty", allocationSize = 1)
    private Long id;

    @Builder.Default
    @Enumerated(EnumType.STRING)
    private PartyType type = PartyType.INDIVIDUAL;

    @Builder.Default
    private String legalType = "";

    @Builder.Default
    private String displayName = "";

    @ManyToMany(fetch = FetchType.EAGER)
    @JoinTable(name = "PartyAddress", joinColumns = @JoinColumn(name = "partyId"), inverseJoinColumns = @JoinColumn(name = "locationId"))
    private Set<Address> addresses;

    @ManyToMany(fetch = FetchType.EAGER)
    @JoinTable(name = "PartyRole", joinColumns = @JoinColumn(name = "partyId"), inverseJoinColumns = @JoinColumn(name = "roleId"))
    private Set<Role> roles;

    // 
    // Spring Data audit annotations in nested (embeddable) clreplacedes isn't supported yet.
    // See: https://jira.spring.io/browse/DATACMNS-1274
    // 
    // @Embedded
    // private Auditable auditable;
    // 
    @CreatedBy
    private String createdBy;

    @CreatedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdAt;

    @LastModifiedBy
    private String updatedBy;

    @LastModifiedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date updatedAt;

    // Equals and hashCode must behave consistently across all enreplacedy state transitions
    // See: https://vladmihalcea.com/the-best-way-to-implement-equals-hashcode-and-tostring-with-jpa-and-hibernate/
    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (!(o instanceof Party))
            return false;
        Party other = (Party) o;
        return id != 0L && id.equals(other.getId());
    }

    @Override
    public int hashCode() {
        return 31;
    }
}

18 Source : Location.java
with MIT License
from Robinyo

@Enreplacedy
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Setter
@Getter
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public clreplaced Location {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SequenceLocation")
    @SequenceGenerator(name = "SequenceLocation", allocationSize = 1)
    private Long id;

    @Builder.Default
    @Enumerated(EnumType.STRING)
    private LocationType type = LocationType.ADDRESS;

    @Builder.Default
    private String displayName = "";

    @Temporal(TemporalType.TIMESTAMP)
    private Date fromDate;

    @Temporal(TemporalType.TIMESTAMP)
    private Date toDate;

    // 
    // @Embedded
    // private Auditable audit;
    // 
    @CreatedBy
    private String createdBy;

    @CreatedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdAt;

    @LastModifiedBy
    private String updatedBy;

    @LastModifiedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date updatedAt;

    @Override
    public boolean equals(Object o) {
        if (this == o)
            return true;
        if (!(o instanceof Location))
            return false;
        Location other = (Location) o;
        return id != 0L && id.equals(other.getId());
    }

    @Override
    public int hashCode() {
        return 31;
    }
}

18 Source : Identifier.java
with MIT License
from Robinyo

@Enreplacedy
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Setter
@Getter
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public clreplaced Identifier {

    @Id
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SequenceIdentifier")
    @SequenceGenerator(name = "SequenceIdentifier", allocationSize = 1)
    private Long id;

    @Column(name = "type", nullable = false)
    private String // name: ABN
    type;

    @Column(name = "value", nullable = false)
    private String // code: 85 087 326 690
    value;

    @Column(name = "register", nullable = false)
    private String // issuer: Australian Business Register
    register;

    // status: Active
    private String lifecycleStatus;

    @Temporal(TemporalType.TIMESTAMP)
    private Date // start date: YYYYMMDD
    fromDate;

    @Temporal(TemporalType.TIMESTAMP)
    private Date // end date: YYYYMMDD
    toDate;

    // 
    // Spring Data audit annotations in nested (embeddable) clreplacedes isn't supported yet.
    // See: https://jira.spring.io/browse/DATACMNS-1274
    // 
    // @Embedded
    // private Auditable audit;
    // 
    @CreatedBy
    private String createdBy;

    @CreatedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdAt;

    @LastModifiedBy
    private String updatedBy;

    @LastModifiedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date updatedAt;
}

18 Source : Comment.java
with MIT License
from PacktPublishing

/**
 * @author Shazin Sadakath
 */
@Enreplacedy
@Table(name = "rb_comment")
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
@Data
public clreplaced Comment {

    @Id
    @GeneratedValue
    private Long id;

    private String comment;

    @Enumerated(EnumType.STRING)
    private CommentType type;

    @CreatedDate
    private Timestamp createdDate;

    @CreatedBy
    private String createdBy;
}

18 Source : AbstractUserDateAudit.java
with Apache License 2.0
from ngcly

/**
 * @author ngcly
 */
@MappedSuperclreplaced
@JsonIgnoreProperties(value = { "createdBy", "updatedBy" }, allowGetters = true)
public abstract clreplaced AbstractUserDateAudit extends AbstractDateAudit {

    @CreatedBy
    private String createdBy;

    @LastModifiedBy
    private String updatedBy;

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public String getUpdatedBy() {
        return updatedBy;
    }

    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }
}

18 Source : AbstractAuditingEntity.java
with MIT License
from ls1intum

/**
 * Base abstract clreplaced for enreplacedies which will hold definitions for created, last modified by and created, last modified by date.
 */
@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public abstract clreplaced AbstractAuditingEnreplacedy extends DomainObject {

    @CreatedBy
    @Column(name = "created_by", nullable = false, length = 50, updatable = false)
    @JsonIgnore
    private String createdBy;

    @CreatedDate
    @Column(name = "created_date", updatable = false)
    @JsonIgnore
    private Instant createdDate = Instant.now();

    @LastModifiedBy
    @Column(name = "last_modified_by", length = 50)
    @JsonIgnore
    private String lastModifiedBy;

    @LastModifiedDate
    @Column(name = "last_modified_date")
    @JsonIgnore
    private Instant lastModifiedDate = Instant.now();

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public Instant getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Instant createdDate) {
        this.createdDate = createdDate;
    }

    public String getLastModifiedBy() {
        return lastModifiedBy;
    }

    public void setLastModifiedBy(String lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
    }

    public Instant getLastModifiedDate() {
        return lastModifiedDate;
    }

    public void setLastModifiedDate(Instant lastModifiedDate) {
        this.lastModifiedDate = lastModifiedDate;
    }
}

18 Source : UserEntity.java
with Apache License 2.0
from kioyong

@Data
@Doreplacedent(collection = "user")
public clreplaced UserEnreplacedy {

    @Id
    private String username;

    private String preplacedword;

    private Set<GrantedAuthority> authorities;

    private boolean accountNonExpired;

    private boolean accountNonLocked;

    private boolean credentialsNonExpired;

    private boolean enabled;

    // TODO
    @CreatedDate
    private LocalDateTime createdDate;

    @LastModifiedDate
    private LocalDateTime lastModifiedDate;

    @CreatedBy
    private String createdBy;

    @LastModifiedDate
    private String lastModifiedBy;
}

18 Source : AuditableEntity.java
with MIT License
from InnovateUKGitHub

/**
 * Base clreplaced to provide Spring Data Auditing.
 * <p>
 * Concrete enreplacedies should be mapped on to a table with the following columns:
 * <ul>
 *     <li><pre>created_by bigint(20) NOT NULL</pre></li>
 *     <li><pre>created_on datetime NOT NULL</pre></li>
 *     <li><pre>modified_by bigint(20) NOT NULL</pre></li>
 *     <li><pre>modified_on datetime NOT NULL</pre></li>
 * </ul>
 *
 * @see AuditConfig
 */
@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public abstract clreplaced AuditableEnreplacedy implements Auditable {

    @CreatedBy
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "createdBy", referencedColumnName = "id")
    private User createdBy;

    @CreatedDate
    private ZonedDateTime createdOn;

    @LastModifiedBy
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "modifiedBy", referencedColumnName = "id")
    private User modifiedBy;

    @LastModifiedDate
    private ZonedDateTime modifiedOn;

    @Override
    public User getCreatedBy() {
        return createdBy;
    }

    @Override
    public ZonedDateTime getCreatedOn() {
        return createdOn;
    }

    @Override
    public User getModifiedBy() {
        return modifiedBy;
    }

    @Override
    public ZonedDateTime getModifiedOn() {
        return modifiedOn;
    }
}

18 Source : DemoApplication.java
with GNU General Public License v3.0
from hantsy

@Table("posts")
@Data
@ToString
@Builder
@NoArgsConstructor
@AllArgsConstructor
clreplaced Post {

    @PrimaryKeyColumn(name = "id", type = PrimaryKeyType.PARreplacedIONED)
    @Builder.Default
    private UUID id = UUID.randomUUID();

    private String replacedle;

    private String content;

    @CreatedBy
    private String createdBy;

    @CreatedDate
    private LocalDateTime createdDate;

    @LastModifiedBy
    private String updatedBy;

    @LastModifiedDate
    private LocalDateTime updatedDate;
}

18 Source : OperateLog.java
with MIT License
from fengdis

/**
 * @version 1.0
 * @Descrittion: 操作日志实体
 * @author: fengdi
 * @since: 2018/9/3 0003 22:51
 */
@Enreplacedy
@Table(name = "tb_log_operate")
@EnreplacedyListeners({ AuditingEnreplacedyListener.clreplaced })
public clreplaced OperateLog implements Serializable {

    private static final long serialVersionUID = -3216447093712453224L;

    @Id
    /*@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "log_gen")
	@SequenceGenerator(name = "log_gen", sequenceName = "demo_log_seq")
	private Long id;*/
    @GeneratedValue(generator = "OperateLogGenerator")
    @GenericGenerator(name = "OperateLogGenerator", strategy = "uuid")
    @Column(length = 32)
    private String id;

    @Column(nullable = false, length = 20)
    private String name;

    @Column
    private String info;

    @Column(length = 20)
    @CreatedBy
    private String account;

    @Column(nullable = false, length = 20)
    private String clientIp;

    @Column(nullable = false, length = 20)
    private String serverIp;

    @Column
    @Temporal(TemporalType.TIMESTAMP)
    @CreatedDate
    @JsonSerialize(using = Date2DTString.clreplaced)
    private Date hapendTime;

    @Column(nullable = false, length = 20)
    private Long elapsedTime;

    private String method;

    @Column(columnDefinition = "text")
    private String params;

    @Column(columnDefinition = "text")
    private byte[] exception;

    @Column(nullable = false, length = 10)
    @Enumerated(EnumType.STRING)
    private OperateType operateType;

    @Column(nullable = false, length = 10)
    @Enumerated(EnumType.STRING)
    private ResultType resultType;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getClientIp() {
        return clientIp;
    }

    public void setClientIp(String clientIp) {
        this.clientIp = clientIp;
    }

    public String getServerIp() {
        return serverIp;
    }

    public void setServerIp(String serverIp) {
        this.serverIp = serverIp;
    }

    public Date getHapendTime() {
        return hapendTime;
    }

    public void setHapendTime(Date hapendTime) {
        this.hapendTime = hapendTime;
    }

    public Long getElapsedTime() {
        return elapsedTime;
    }

    public void setElapsedTime(Long elapsedTime) {
        this.elapsedTime = elapsedTime;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }

    public byte[] getException() {
        return exception;
    }

    public void setException(byte[] exception) {
        this.exception = exception;
    }

    public OperateType getOperateType() {
        return operateType;
    }

    public void setOperateType(OperateType operateType) {
        this.operateType = operateType;
    }

    public ResultType getResultType() {
        return resultType;
    }

    public void setResultType(ResultType resultType) {
        this.resultType = resultType;
    }
}

18 Source : Auditable.java
with MIT License
from attacomsian

@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public abstract clreplaced Auditable<T> {

    @CreatedBy
    protected T createdBy;

    @Temporal(TemporalType.TIMESTAMP)
    @CreatedDate
    protected Date createdDate;

    @LastModifiedBy
    protected T lastModifiedBy;

    @Temporal(TemporalType.TIMESTAMP)
    @LastModifiedDate
    protected Date lastModifiedDate;

    public T getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(T createdBy) {
        this.createdBy = createdBy;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    public T getLastModifiedBy() {
        return lastModifiedBy;
    }

    public void setLastModifiedBy(T lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
    }

    public Date getLastModifiedDate() {
        return lastModifiedDate;
    }

    public void setLastModifiedDate(Date lastModifiedDate) {
        this.lastModifiedDate = lastModifiedDate;
    }
}

18 Source : AuditableEntity.java
with Apache License 2.0
from atereshkov

@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public abstract clreplaced AuditableEnreplacedy<U> extends BaseEnreplacedy {

    @CreatedBy
    protected U createdBy;

    @CreatedDate
    @Temporal(TemporalType.TIMESTAMP)
    protected Date createdDate;

    @LastModifiedBy
    protected U lastModifiedBy;

    @LastModifiedDate
    @Temporal(TemporalType.TIMESTAMP)
    protected Date lastModifiedDate;

    public U getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(U createdBy) {
        this.createdBy = createdBy;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    public U getLastModifiedBy() {
        return lastModifiedBy;
    }

    public void setLastModifiedBy(U lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
    }

    public Date getLastModifiedDate() {
        return lastModifiedDate;
    }

    public void setLastModifiedDate(Date lastModifiedDate) {
        this.lastModifiedDate = lastModifiedDate;
    }
}

18 Source : AuditableEntity.java
with Apache License 2.0
from Activiti

/**
 * Base clreplaced for auditable enreplacedies.
 */
@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public abstract clreplaced AuditableEnreplacedy<U> implements Auditable<U> {

    @CreatedBy
    protected U createdBy;

    @CreatedDate
    @Temporal(TemporalType.TIMESTAMP)
    protected Date creationDate;

    @LastModifiedBy
    protected U lastModifiedBy;

    @LastModifiedDate
    @Temporal(TemporalType.TIMESTAMP)
    protected Date lastModifiedDate;

    public U getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(U createdBy) {
        this.createdBy = createdBy;
    }

    public Date getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(Date creationDate) {
        this.creationDate = creationDate;
    }

    public U getLastModifiedBy() {
        return lastModifiedBy;
    }

    public void setLastModifiedBy(U lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
    }

    public Date getLastModifiedDate() {
        return lastModifiedDate;
    }

    public void setLastModifiedDate(Date lastModifiedDate) {
        this.lastModifiedDate = lastModifiedDate;
    }
}

18 Source : AuditingModel.java
with GNU Lesser General Public License v2.1
from abixen

@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public abstract clreplaced AuditingModel extends Model {

    @CreatedBy
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "created_by_id")
    private User createdBy;

    @CreatedDate
    @Column(name = "created_date")
    private Date createdDate;

    @LastModifiedBy
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "last_modified_by_id")
    private User lastModifiedBy;

    @LastModifiedDate
    @Column(name = "last_modified_date")
    private Date lastModifiedDate;

    public abstract Long getId();

    public User getCreatedBy() {
        if (this instanceof User) {
            if (!this.equals(createdBy)) {
                return createdBy;
            } else {
                return null;
            }
        }
        return createdBy;
    }

    void setCreatedBy(User createdBy) {
        if (this instanceof User) {
            if (this.equals(createdBy)) {
                this.createdBy = null;
            } else {
                this.createdBy = createdBy;
            }
        } else {
            this.createdBy = createdBy;
        }
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    public User getLastModifiedBy() {
        if (this instanceof User) {
            if (!this.equals(lastModifiedBy)) {
                return lastModifiedBy;
            } else {
                return null;
            }
        }
        return lastModifiedBy;
    }

    void setLastModifiedBy(User lastModifiedBy) {
        if (this instanceof User) {
            if (this.equals(lastModifiedBy)) {
                this.lastModifiedBy = null;
            } else {
                this.lastModifiedBy = lastModifiedBy;
            }
        } else {
            this.lastModifiedBy = lastModifiedBy;
        }
    }

    public Date getLastModifiedDate() {
        return lastModifiedDate;
    }

    void setLastModifiedDate(Date lastModifiedDate) {
        this.lastModifiedDate = lastModifiedDate;
    }

    @Override
    public String toString() {
        StringBuilder result = new StringBuilder();
        String newLine = System.getProperty("line.separator");
        result.append(this.getClreplaced().getName());
        result.append(newLine);
        result.append("Object {");
        result.append(newLine);
        Field[] fields = this.getClreplaced().getDeclaredFields();
        AccessibleObject.setAccessible(fields, true);
        for (Field field : fields) {
            if (!Modifier.isStatic(field.getModifiers())) {
                result.append("    ");
                try {
                    result.append(field.getName());
                    result.append(": ");
                    Object object = field.get(this);
                    if (object instanceof AuditingModel) {
                        result.append(((AuditingModel) field.get(this)).getId());
                    } else {
                        result.append(field.get(this));
                    }
                } catch (IllegalAccessException e) {
                    e.printStackTrace();
                }
                result.append(newLine);
            }
        }
        result.append("    createdBy: ");
        result.append(getCreatedBy() != null ? getCreatedBy().getUsername() : null);
        result.append(newLine);
        result.append("    createdDate: ");
        result.append(getCreatedDate());
        result.append(newLine);
        result.append("    lastModifiedBy: ");
        result.append(getLastModifiedBy() != null ? getLastModifiedBy().getUsername() : null);
        result.append(newLine);
        result.append("    lastModifiedDate: ");
        result.append(getLastModifiedDate());
        result.append(newLine);
        result.append("}");
        return result.toString();
    }
}

17 Source : BaseEntity.java
with MIT License
from yupaits

/**
 * @author yupaits
 * @date 2018/8/11
 */
@Data
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
@MappedSuperclreplaced
public abstract clreplaced BaseEnreplacedy<ID extends Serializable> implements Serializable {

    @Id
    @GeneratedValue(generator = "IdWorker")
    @GenericGenerator(name = "IdWorker", strategy = "com.yupaits.docs.common.utils.SnowflakeIdWorker")
    @Column(unique = true, length = 18)
    private ID id;

    @Column(name = "created_at", nullable = false, updatable = false)
    @CreatedDate
    private Date createdAt;

    @Column(name = "created_by", nullable = false, updatable = false)
    @CreatedBy
    private String createdBy;

    @Column(name = "last_modified_at", nullable = false)
    @LastModifiedDate
    private Date lastModifiedAt;

    @Column(name = "last_modified_by", nullable = false)
    @LastModifiedBy
    private String lastModifiedBy;
}

17 Source : Config.java
with Apache License 2.0
from xwjie

@Enreplacedy
@Data
@EqualsAndHashCode(callSuper = true)
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public clreplaced Config extends BaseEnreplacedy {

    private static final long serialVersionUID = 1L;

    private String name, description, value;

    /**
     * 创建者
     */
    @CreatedBy
    @ManyToOne
    private User creator;
}

17 Source : Blog.java
with Apache License 2.0
from xwjie

@Enreplacedy
@lombok.Data
@EqualsAndHashCode(callSuper = true)
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public clreplaced Blog extends BaseEnreplacedy implements Favoritable {

    // , message = "{javax.validation.constraints.Size.message}"
    @Size(min = 3, max = 30)
    private String replacedle;

    @Size(min = 10, max = 30000)
    @Lob
    private String body;

    /**
     *  收藏数
     */
    int favoriteCount;

    /**
     * 创建者
     */
    @CreatedBy
    @ManyToOne
    private User creator;
}

17 Source : AbstractAuditingEntity.java
with Apache License 2.0
from xm-online

/**
 * Base abstract clreplaced for enreplacedies which will hold definitions for created, last modified by and created,
 * last modified by date.
 */
@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public abstract clreplaced AbstractAuditingEnreplacedy implements Serializable {

    private static final long serialVersionUID = 1L;

    @CreatedBy
    @Column(name = "created_by", nullable = false, length = 50, updatable = false)
    @JsonIgnore
    private String createdBy;

    @CreatedDate
    @Column(name = "created_date", nullable = false)
    @JsonIgnore
    private Instant createdDate = Instant.now();

    @LastModifiedBy
    @Column(name = "last_modified_by", length = 50)
    @JsonIgnore
    private String lastModifiedBy;

    @LastModifiedDate
    @Column(name = "last_modified_date")
    @JsonIgnore
    private Instant lastModifiedDate = Instant.now();

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public Instant getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Instant createdDate) {
        this.createdDate = createdDate;
    }

    public String getLastModifiedBy() {
        return lastModifiedBy;
    }

    public void setLastModifiedBy(String lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
    }

    public Instant getLastModifiedDate() {
        return lastModifiedDate;
    }

    public void setLastModifiedDate(Instant lastModifiedDate) {
        this.lastModifiedDate = lastModifiedDate;
    }
}

17 Source : AbstractAuditingEntity.java
with BSD 3-Clause "New" or "Revised" License
from ueboot

/**
 * <p>
 * replacedle: AbstractAuditingEnreplacedy
 * </p>
 * <p>
 * Description: AbstractAuditingEnreplacedy(创建人,创建时间,更新人,更新时间)
 * </p>
 * <p>
 * Copyright: Copyright (c) 2018
 * </p>
 * <p>
 * Company: XiQiao
 * </p>
 *
 * @author: wanglijun
 * @version:1.0
 */
@Getter
@Setter
@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public abstract clreplaced AbstractAuditingEnreplacedy<PK> extends AbstractSuperEnreplacedy<PK> {

    /**
     * 创建人名称
     */
    @CreatedBy
    @Column(name = "CREATED_BY")
    protected String createdBy;

    /**
     * 首次插入时间
     */
    @CreatedDate
    @Column(name = "CREATED_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    protected Date createdDate;

    /**
     * 最后修改人名称
     */
    @LastModifiedBy
    @Column(name = "LAST_MODIFIED_BY")
    protected String lastModifiedBy;

    /**
     * 最后修改时间
     */
    @LastModifiedDate
    @Column(name = "LAST_MODIFIED_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    protected Date lastModifiedDate;
}

17 Source : AbstractAuditingEntity.java
with MIT License
from tillias

/**
 * Base abstract clreplaced for enreplacedies which will hold definitions for created, last modified, created by,
 * last modified by attributes.
 */
@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public abstract clreplaced AbstractAuditingEnreplacedy implements Serializable {

    private static final long serialVersionUID = 1L;

    @CreatedBy
    @Column(name = "created_by", nullable = false, length = 50, updatable = false)
    @JsonIgnore
    private String createdBy;

    @CreatedDate
    @Column(name = "created_date", updatable = false)
    @JsonIgnore
    private Instant createdDate = Instant.now();

    @LastModifiedBy
    @Column(name = "last_modified_by", length = 50)
    @JsonIgnore
    private String lastModifiedBy;

    @LastModifiedDate
    @Column(name = "last_modified_date")
    @JsonIgnore
    private Instant lastModifiedDate = Instant.now();

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public Instant getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Instant createdDate) {
        this.createdDate = createdDate;
    }

    public String getLastModifiedBy() {
        return lastModifiedBy;
    }

    public void setLastModifiedBy(String lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
    }

    public Instant getLastModifiedDate() {
        return lastModifiedDate;
    }

    public void setLastModifiedDate(Instant lastModifiedDate) {
        this.lastModifiedDate = lastModifiedDate;
    }
}

17 Source : BaseEntity.java
with Apache License 2.0
from ppdaicorp

@Data
@Cacheable(false)
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
@MappedSuperclreplaced
public clreplaced BaseEnreplacedy {

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "insert_time", insertable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
    public Date insertTime;

    @CreatedBy
    @Column(name = "insert_by", nullable = true, length = 64)
    public String insertBy;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "update_time", insertable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
    public Date updateTime;

    @LastModifiedBy
    @Column(name = "update_by", nullable = true, length = 64)
    public String updateBy;

    @Column(name = "is_active", nullable = false, columnDefinition = "TINYINT(1)")
    public Boolean isActive = true;
}

17 Source : BaseEntity.java
with Apache License 2.0
from ppdaicorp

/**
 * base enreplacedy
 */
@Data
@Cacheable(false)
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
@MappedSuperclreplaced
public clreplaced BaseEnreplacedy {

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "insert_time", insertable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
    public Date insertTime;

    @CreatedBy
    @Column(name = "insert_by", nullable = true, length = 64)
    public String insertBy;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "update_time", insertable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
    public Date updateTime;

    @LastModifiedBy
    @Column(name = "update_by", nullable = true, length = 64)
    public String updateBy;

    @Column(name = "is_active", nullable = false, columnDefinition = "TINYINT(1)")
    public Boolean isActive = true;
}

17 Source : BaseEntity.java
with Apache License 2.0
from peipeihh

/**
 * BaseEnreplacedy
 *
 * @author huangyinhuang
 * @date 7/3/2018
 */
@Data
@Cacheable(false)
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
@MappedSuperclreplaced
public clreplaced BaseEnreplacedy {

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "insert_time", insertable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP")
    public Date insertTime;

    @CreatedBy
    @Column(name = "insert_by", nullable = true, length = 64)
    public String insertBy;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "update_time", insertable = false, updatable = false, columnDefinition = "TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP")
    public Date updateTime;

    @LastModifiedBy
    @Column(name = "update_by", nullable = true, length = 64)
    public String updateBy;

    @Column(name = "is_active", nullable = false, columnDefinition = "TINYINT(1)")
    public Boolean isActive = true;
}

17 Source : AbstractAuditingEntity.java
with MIT License
from PacktPublishing

/**
 * Base abstract clreplaced for enreplacedies which will hold definitions for created, last modified by and created,
 * last modified by date.
 */
@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public abstract clreplaced AbstractAuditingEnreplacedy implements Serializable {

    private static final long serialVersionUID = 1L;

    @CreatedBy
    @Column(name = "created_by", nullable = false, length = 50, updatable = false)
    @JsonIgnore
    private String createdBy;

    @CreatedDate
    @Column(name = "created_date", updatable = false)
    @JsonIgnore
    private Instant createdDate = Instant.now();

    @LastModifiedBy
    @Column(name = "last_modified_by", length = 50)
    @JsonIgnore
    private String lastModifiedBy;

    @LastModifiedDate
    @Column(name = "last_modified_date")
    @JsonIgnore
    private Instant lastModifiedDate = Instant.now();

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public Instant getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Instant createdDate) {
        this.createdDate = createdDate;
    }

    public String getLastModifiedBy() {
        return lastModifiedBy;
    }

    public void setLastModifiedBy(String lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
    }

    public Instant getLastModifiedDate() {
        return lastModifiedDate;
    }

    public void setLastModifiedDate(Instant lastModifiedDate) {
        this.lastModifiedDate = lastModifiedDate;
    }
}

17 Source : ImmutableAuditableThingWithGeneratedId.java
with Apache License 2.0
from neo4j

/**
 * @author Michael J. Simons
 */
@Value
@With
@AllArgsConstructor(onConstructor = @__(@PersistenceConstructor))
@Persistent
public clreplaced ImmutableAuditableThingWithGeneratedId implements AuditableThing {

    @Id
    @GeneratedValue(UUIDStringGenerator.clreplaced)
    String id;

    @CreatedDate
    LocalDateTime createdAt;

    @CreatedBy
    String createdBy;

    @LastModifiedDate
    LocalDateTime modifiedAt;

    @LastModifiedBy
    String modifiedBy;

    String name;

    public ImmutableAuditableThingWithGeneratedId(String name) {
        this(null, null, null, null, null, name);
    }
}

17 Source : ImmutableAuditableThing.java
with Apache License 2.0
from neo4j

/**
 * @author Michael J. Simons
 */
@Value
@With
@AllArgsConstructor(onConstructor = @__(@PersistenceConstructor))
@Persistent
public clreplaced ImmutableAuditableThing implements AuditableThing {

    @Id
    @GeneratedValue
    Long id;

    @CreatedDate
    LocalDateTime createdAt;

    @CreatedBy
    String createdBy;

    @LastModifiedDate
    LocalDateTime modifiedAt;

    @LastModifiedBy
    String modifiedBy;

    String name;

    public ImmutableAuditableThing(String name) {
        this(null, null, null, null, null, name);
    }
}

17 Source : DeletedApplicationAudit.java
with MIT License
from InnovateUKGitHub

/**
 * Enreplacedy representing a deleted application.
 */
@Enreplacedy
@Immutable
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public clreplaced DeletedApplicationAudit {

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

    private long applicationId;

    @CreatedBy
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "deletedBy", referencedColumnName = "id")
    private User deletedBy;

    @CreatedDate
    private ZonedDateTime deletedOn;

    public DeletedApplicationAudit(long applicationId) {
        this.applicationId = applicationId;
    }

    public Long getId() {
        return id;
    }

    public long getApplicationId() {
        return applicationId;
    }

    public User getDeletedBy() {
        return deletedBy;
    }

    public ZonedDateTime getDeletedOn() {
        return deletedOn;
    }
}

17 Source : AbstractAuditableEntity.java
with GNU General Public License v3.0
from hantsy

@Getter
@Setter
@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public abstract clreplaced AbstractAuditableEnreplacedy<ID> extends AbstractPersistableEnreplacedy<ID> implements Serializable {

    @CreatedDate
    LocalDate createdDate;

    @LastModifiedDate
    LocalDate lastModifiedDate;

    @CreatedBy
    // @ManyToOne
    // @JoinColumn(name = "created_by")
    @AttributeOverride(name = "username", column = @Column(name = "created_by"))
    @Embedded
    Username createdBy;

    @LastModifiedBy
    // @ManyToOne
    // @JoinColumn(name = "last_modified_by")
    @AttributeOverride(name = "username", column = @Column(name = "last_modified_by"))
    @Embedded
    Username lastModifiedBy;
}

17 Source : User.java
with Apache License 2.0
from givanthak

/**
 * The type User.
 *
 * @author Givantha Kalansuriya
 */
@Enreplacedy
@Table(name = "users")
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public clreplaced User {

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

    @Column(name = "first_name", nullable = false)
    private String firstName;

    @Column(name = "last_name", nullable = false)
    private String lastName;

    @Column(name = "email_address", nullable = false)
    private String email;

    @CreationTimestamp
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "created_at", nullable = false)
    private Date createdAt;

    @Column(name = "created_by", nullable = false)
    @CreatedBy
    private String createdBy;

    @UpdateTimestamp
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "updated_at", nullable = false)
    private Date updatedAt;

    @Column(name = "updated_by", nullable = false)
    @LastModifiedBy
    private String updatedBy;

    /**
     * Gets id.
     *
     * @return the id
     */
    public long getId() {
        return id;
    }

    /**
     * Sets id.
     *
     * @param id the id
     */
    public void setId(long id) {
        this.id = id;
    }

    /**
     * Gets first name.
     *
     * @return the first name
     */
    public String getFirstName() {
        return firstName;
    }

    /**
     * Sets first name.
     *
     * @param firstName the first name
     */
    public void setFirstName(String firstName) {
        this.firstName = firstName;
    }

    /**
     * Gets last name.
     *
     * @return the last name
     */
    public String getLastName() {
        return lastName;
    }

    /**
     * Sets last name.
     *
     * @param lastName the last name
     */
    public void setLastName(String lastName) {
        this.lastName = lastName;
    }

    /**
     * Gets email.
     *
     * @return the email
     */
    public String getEmail() {
        return email;
    }

    /**
     * Sets email.
     *
     * @param email the email
     */
    public void setEmail(String email) {
        this.email = email;
    }

    /**
     * Gets created at.
     *
     * @return the created at
     */
    public Date getCreatedAt() {
        return createdAt;
    }

    /**
     * Sets created at.
     *
     * @param createdAt the created at
     */
    public void setCreatedAt(Date createdAt) {
        this.createdAt = createdAt;
    }

    /**
     * Gets created by.
     *
     * @return the created by
     */
    public String getCreatedBy() {
        return createdBy;
    }

    /**
     * Sets created by.
     *
     * @param createdBy the created by
     */
    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    /**
     * Gets updated at.
     *
     * @return the updated at
     */
    public Date getUpdatedAt() {
        return updatedAt;
    }

    /**
     * Sets updated at.
     *
     * @param updatedAt the updated at
     */
    public void setUpdatedAt(Date updatedAt) {
        this.updatedAt = updatedAt;
    }

    /**
     * Gets updated by.
     *
     * @return the updated by
     */
    public String getUpdatedBy() {
        return updatedBy;
    }

    /**
     * Sets updated by.
     *
     * @param updatedBy the updated by
     */
    public void setUpdatedBy(String updatedBy) {
        this.updatedBy = updatedBy;
    }

    @Override
    public String toString() {
        return "User{" + "id=" + id + ", firstName='" + firstName + '\'' + ", lastName='" + lastName + '\'' + ", email='" + email + '\'' + ", createdAt=" + createdAt + ", createdBy='" + createdBy + '\'' + ", updatedAt=" + updatedAt + ", updatedby='" + updatedBy + '\'' + '}';
    }
}

17 Source : EventLog.java
with MIT License
from fengdis

/**
 * @version 1.0
 * @Descrittion: 异常日志实体
 * @author: fengdi
 * @since: 2018/9/3 0003 22:51
 */
@Enreplacedy
@Table(name = "tb_log_event")
@EnreplacedyListeners({ AuditingEnreplacedyListener.clreplaced })
public clreplaced EventLog implements Serializable {

    private static final long serialVersionUID = 107680660747040911L;

    @Id
    /*@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "log_gen")
	@SequenceGenerator(name = "log_gen", sequenceName = "demo_log_seq")
	private Long id;*/
    @GeneratedValue(generator = "EventLogGenerator")
    @GenericGenerator(name = "EventLogGenerator", strategy = "uuid")
    @Column(length = 32)
    private String id;

    @Column(nullable = false, length = 20)
    private String name;

    @Column
    private String info;

    @Column(length = 20)
    @CreatedBy
    private String account;

    @Column(nullable = false, length = 20)
    private String clientIp;

    @Column
    @Temporal(TemporalType.TIMESTAMP)
    @CreatedDate
    @JsonSerialize(using = Date2DTString.clreplaced)
    private Date hapendTime;

    private String method;

    @Column(columnDefinition = "text")
    private String params;

    @Column(length = 20)
    private String serverIp;

    @Column
    private String position;

    @Column(nullable = false, length = 10)
    @Enumerated(EnumType.STRING)
    private EventType eventType;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public String getAccount() {
        return account;
    }

    public void setAccount(String account) {
        this.account = account;
    }

    public String getClientIp() {
        return clientIp;
    }

    public void setClientIp(String clientIp) {
        this.clientIp = clientIp;
    }

    public Date getHapendTime() {
        return hapendTime;
    }

    public void setHapendTime(Date hapendTime) {
        this.hapendTime = hapendTime;
    }

    public String getMethod() {
        return method;
    }

    public void setMethod(String method) {
        this.method = method;
    }

    public String getParams() {
        return params;
    }

    public void setParams(String params) {
        this.params = params;
    }

    public String getServerIp() {
        return serverIp;
    }

    public void setServerIp(String serverIp) {
        this.serverIp = serverIp;
    }

    public String getPosition() {
        return position;
    }

    public void setPosition(String position) {
        this.position = position;
    }

    public EventType getEventType() {
        return eventType;
    }

    public void setEventType(EventType eventType) {
        this.eventType = eventType;
    }
}

17 Source : BaseEntity.java
with MIT License
from cocoding-ss

@Getter
@Setter
@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public abstract clreplaced BaseEnreplacedy {

    @CreatedDate
    @Column(name = "created_at")
    private LocalDateTime createdAt;

    @LastModifiedDate
    @Column(name = "updated_at")
    private LocalDateTime updatedAt;

    @Column(name = "deleted_at")
    private LocalDateTime deletedAt;

    @CreatedBy
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "created_by", referencedColumnName = "USER_ID")
    private User createdBy;

    @LastModifiedBy
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "updated_by", referencedColumnName = "USER_ID")
    private User updatedBy;
}

17 Source : Role.java
with MIT License
from auntvt

/**
 * @author 小懒虫
 * @date 2018/8/14
 */
@Data
@Enreplacedy
@Table(name = "sys_role")
@ToString(exclude = { "users", "menus", "createBy", "updateBy" })
@EqualsAndHashCode(exclude = { "users", "menus", "createBy", "updateBy" })
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
@SQLDelete(sql = "update sys_role" + StatusUtil.SLICE_DELETE)
@Where(clause = StatusUtil.NOT_DELETE)
public clreplaced Role implements Serializable {

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

    private String name;

    private String replacedle;

    private String remark;

    @CreatedDate
    private Date createDate;

    @LastModifiedDate
    private Date updateDate;

    @CreatedBy
    @ManyToOne(fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "create_by")
    @JsonIgnore
    private User createBy;

    @LastModifiedBy
    @ManyToOne(fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "update_by")
    @JsonIgnore
    private User updateBy;

    private Byte status = StatusEnum.OK.getCode();

    @ManyToMany(mappedBy = "roles", cascade = { CascadeType.PERSIST, CascadeType.MERGE })
    @JsonIgnore
    private Set<User> users = new HashSet<>(0);

    @ManyToMany(fetch = FetchType.LAZY)
    @JoinTable(name = "sys_role_menu", joinColumns = @JoinColumn(name = "role_id"), inverseJoinColumns = @JoinColumn(name = "menu_id"))
    @JsonIgnore
    private Set<Menu> menus = new HashSet<>(0);
}

17 Source : Menu.java
with MIT License
from auntvt

/**
 * @author 小懒虫
 * @date 2018/8/14
 */
@Data
@Enreplacedy
@Table(name = "sys_menu")
@ToString(exclude = { "roles", "createBy", "updateBy" })
@EqualsAndHashCode(exclude = { "roles", "createBy", "updateBy" })
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
@Where(clause = StatusUtil.NOT_DELETE)
public clreplaced Menu implements Serializable {

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

    private Long pid;

    private String pids;

    private String replacedle;

    private String url;

    private String perms;

    private String icon;

    private Byte type;

    private Integer sort;

    private String remark;

    @CreatedDate
    private Date createDate;

    @LastModifiedDate
    private Date updateDate;

    @CreatedBy
    @ManyToOne(fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "create_by")
    @JsonIgnore
    private User createBy;

    @LastModifiedBy
    @ManyToOne(fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "update_by")
    @JsonIgnore
    private User updateBy;

    private Byte status = StatusEnum.OK.getCode();

    @ManyToMany(mappedBy = "menus")
    @JsonIgnore
    private Set<Role> roles = new HashSet<>(0);

    @Transient
    @JsonIgnore
    private Map<Long, Menu> children = new HashMap<>();

    public Menu() {
    }

    public Menu(Long id, String replacedle, String pids) {
        this.id = id;
        this.replacedle = replacedle;
        this.pids = pids;
    }

    public void setPids(String pids) {
        if (pids.startsWith(",")) {
            pids = pids.substring(1);
        }
        this.pids = pids;
    }
}

17 Source : BaseEntity.java
with Apache License 2.0
from AnghelLeonard

@MappedSuperclreplaced
@EnreplacedyListeners({ AuditingEnreplacedyListener.clreplaced })
public abstract clreplaced BaseEnreplacedy<U> {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENreplacedY)
    protected Long id;

    @CreatedDate
    protected LocalDateTime created;

    @CreatedBy
    protected U createdBy;

    @LastModifiedDate
    protected LocalDateTime lastModified;

    @LastModifiedBy
    protected U lastModifiedBy;
}

16 Source : BaseEntity.java
with Apache License 2.0
from zhcet-amu

@Data
@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public abstract clreplaced BaseEnreplacedy implements Meta, Serializable {

    @Transient
    private String // For storing temporary info
    meta;

    @CreatedDate
    @JsonIgnore
    private LocalDateTime createdAt;

    @LastModifiedDate
    @JsonIgnore
    private LocalDateTime modifiedAt;

    @CreatedBy
    private String createdBy;

    @LastModifiedBy
    private String modifiedBy;

    @Version
    private Integer version;
}

16 Source : BaseEntity.java
with Apache License 2.0
from xiuhuai

/**
 * @author longzhonghua
 * @data 2018/11/04 22:30
 */
// ENreplacedY基类,让实体类去继承时间字段
@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public abstract clreplaced BaseEnreplacedy {

    /*    @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        protected Integer id;*/
    /*
创建时间
*/
    @CreatedDate
    private Long createTime;

    /*    最后修改时间*/
    @LastModifiedDate
    private Long // @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    updateTime;

    /*  public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }*/
    /*
     * 创建人
     */
    @Column(name = "create_by")
    @CreatedBy
    private Long createBy;

    /*
     * 修改人
     */
    @Column(name = "lastmodified_by")
    @LastModifiedBy
    private String lastmodifiedBy;

    public Long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public String getLastmodifiedBy() {
        return lastmodifiedBy;
    }

    public void setLastmodifiedBy(String lastmodifiedBy) {
        this.lastmodifiedBy = lastmodifiedBy;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }
}

16 Source : BaseEntity.java
with Apache License 2.0
from xiuhuai

/**
 * @author longzhonghua
 * @data 2018/11/04 22:30
 */
/**
 * Description: ENreplacedY基类,让实体类去继承时间字段
 * 1.实体头加注解@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
 * 2.启动类加@EnableJpaAuditing
 * 3.
 * @CreatedDate
 * @Column(name = "createTime")
 * private Date createTime;
 * @LastModifiedDate
 * @Column(name = "updateTime")
 * private Date updateTime;
 * 数据库添加相应控制也可以CURRENT_TIMESTAMP , CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
 */
@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public abstract clreplaced BaseEnreplacedy {

    /*    @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        protected Integer id;*/
    /*
创建时间
*/
    @CreatedDate
    private Long // @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    createTime;

    /*    最后修改时间*/
    @LastModifiedDate
    private Long // @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    updateTime;

    /*
     * 创建人
     */
    @Column(name = "create_by")
    @CreatedBy
    private Long createBy;

    /*
     * 修改人
     */
    @Column(name = "lastmodified_by")
    @LastModifiedBy
    private String lastmodifiedBy;

    public Long getCreateBy() {
        return createBy;
    }

    public void setCreateBy(Long createBy) {
        this.createBy = createBy;
    }

    public String getLastmodifiedBy() {
        return lastmodifiedBy;
    }

    public void setLastmodifiedBy(String lastmodifiedBy) {
        this.lastmodifiedBy = lastmodifiedBy;
    }

    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }
}

16 Source : AbstractAuditingEntity.java
with Apache License 2.0
from xebialabs

/**
 * Base abstract clreplaced for enreplacedies which will hold definitions for created, last modified by and created,
 * last modified by date.
 */
public abstract clreplaced AbstractAuditingEnreplacedy implements Serializable {

    private static final long serialVersionUID = 1L;

    @CreatedBy
    @Field("created_by")
    @JsonIgnore
    private String createdBy;

    @CreatedDate
    @Field("created_date")
    @JsonIgnore
    private Instant createdDate = Instant.now();

    @LastModifiedBy
    @Field("last_modified_by")
    @JsonIgnore
    private String lastModifiedBy;

    @LastModifiedDate
    @Field("last_modified_date")
    @JsonIgnore
    private Instant lastModifiedDate = Instant.now();

    public String getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(String createdBy) {
        this.createdBy = createdBy;
    }

    public Instant getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Instant createdDate) {
        this.createdDate = createdDate;
    }

    public String getLastModifiedBy() {
        return lastModifiedBy;
    }

    public void setLastModifiedBy(String lastModifiedBy) {
        this.lastModifiedBy = lastModifiedBy;
    }

    public Instant getLastModifiedDate() {
        return lastModifiedDate;
    }

    public void setLastModifiedDate(Instant lastModifiedDate) {
        this.lastModifiedDate = lastModifiedDate;
    }
}

16 Source : AuditEnabledEntity.java
with The Unlicense
from rashidi

/**
 * @author Rashidi Zin
 */
@Data
@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public clreplaced AuditEnabledEnreplacedy {

    @CreatedBy
    private String createdBy;

    @CreatedDate
    private Instant createdDate;

    @LastModifiedBy
    private String lastModifiedBy;

    @LastModifiedDate
    private Instant lastModifiedDate;

    @Version
    private Integer version;
}

16 Source : UserDateAudit.java
with GNU Affero General Public License v3.0
from osopromadze

@EqualsAndHashCode(callSuper = true)
@MappedSuperclreplaced
@Data
@JsonIgnoreProperties(value = { "createdBY", "updatedBy" }, allowGetters = true)
public abstract clreplaced UserDateAudit extends DateAudit {

    private static final long serialVersionUID = 1L;

    @CreatedBy
    @Column(updatable = false)
    private Long createdBy;

    @LastModifiedBy
    private Long updatedBy;
}

16 Source : AuditableEntity.java
with MIT License
from maxamel

@Getter
@NoArgsConstructor
@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public clreplaced AuditableEnreplacedy {

    @CreatedBy
    private String createdBy;

    @LastModifiedBy
    private String lastModifiedBy;
}

16 Source : StoredDocument.java
with MIT License
from hmcts

@Enreplacedy
@Builder
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public clreplaced StoredDoreplacedent implements RolesAware {

    @Id
    @GeneratedValue(generator = "uuid2")
    @GenericGenerator(name = "uuid2", strategy = "uuid2")
    @Getter
    @Setter
    private UUID id;

    @Getter
    @Setter
    private String createdBy;

    @Getter
    @Setter
    @CreatedBy
    private String createdByService;

    @Getter
    @Setter
    private String lastModifiedBy;

    @Getter
    @Setter
    @LastModifiedBy
    private String lastModifiedByService;

    @LastModifiedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date modifiedOn;

    @CreatedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date createdOn;

    @Getter
    @Setter
    private boolean deleted;

    @Getter
    @Setter
    private boolean hardDeleted;

    @ManyToOne
    @Getter
    @Setter
    private Folder folder;

    @Getter
    @Setter
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "storedDoreplacedent")
    @OrderColumn(name = "itm_idx")
    private List<DoreplacedentContentVersion> doreplacedentContentVersions;

    @Getter
    @Setter
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "storedDoreplacedent")
    private Set<StoredDoreplacedentAuditEntry> auditEntries;

    @Getter
    @Setter
    @Enumerated
    private Clreplacedifications clreplacedification;

    @ElementCollection
    @Getter
    @Setter
    @CollectionTable(name = "doreplacedentroles", joinColumns = @JoinColumn(name = "doreplacedentroles_id"))
    private Set<String> roles;

    @ElementCollection
    @MapKeyColumn(name = "name")
    @Column(name = "value")
    @Getter
    @Setter
    @CollectionTable(name = "doreplacedentmetadata", joinColumns = @JoinColumn(name = "doreplacedentmetadata_id"))
    private Map<String, String> metadata;

    @Getter
    @Setter
    private Date ttl;

    public StoredDoreplacedent() {
        doreplacedentContentVersions = new ArrayList<>();
    }

    public StoredDoreplacedent(UUID id, String createdBy, String createdByService, String lastModifiedBy, String lastModifiedByService, Date modifiedOn, Date createdOn, boolean deleted, boolean hardDeleted, Folder folder, List<DoreplacedentContentVersion> doreplacedentContentVersions, Set<StoredDoreplacedentAuditEntry> auditEntries, Clreplacedifications clreplacedification, Set<String> roles, Map<String, String> metadata, Date ttl) {
        setId(id);
        setCreatedBy(createdBy);
        setCreatedByService(createdByService);
        this.lastModifiedBy = lastModifiedBy;
        this.setLastModifiedByService(lastModifiedByService);
        setModifiedOn(modifiedOn);
        setCreatedOn(createdOn);
        setDeleted(deleted);
        setHardDeleted(hardDeleted);
        setFolder(folder);
        setDoreplacedentContentVersions(doreplacedentContentVersions);
        setAuditEntries(auditEntries);
        setClreplacedification(clreplacedification);
        setRoles(roles);
        setMetadata(metadata);
        setTtl(ttl);
    }

    public DoreplacedentContentVersion getMostRecentDoreplacedentContentVersion() {
        return CollectionUtils.isEmpty(doreplacedentContentVersions) ? null : doreplacedentContentVersions.get(doreplacedentContentVersions.size() - 1);
    }

    public Date getModifiedOn() {
        return (modifiedOn == null) ? null : new Date(modifiedOn.getTime());
    }

    public void setModifiedOn(Date modifiedOn) {
        this.modifiedOn = (modifiedOn == null) ? null : new Date(modifiedOn.getTime());
    }

    public Date getCreatedOn() {
        return (createdOn == null) ? null : new Date(createdOn.getTime());
    }

    public void setCreatedOn(Date createdOn) {
        this.createdOn = (createdOn == null) ? null : new Date(createdOn.getTime());
    }

    public static clreplaced StoredDoreplacedentBuilder {

        public StoredDoreplacedentBuilder modifiedOn(Date modifiedOn) {
            this.modifiedOn = (modifiedOn == null) ? null : new Date(modifiedOn.getTime());
            return this;
        }

        public StoredDoreplacedentBuilder createdOn(Date createdOn) {
            this.createdOn = (createdOn == null) ? null : new Date(createdOn.getTime());
            return this;
        }
    }
}

16 Source : BaseEntity.java
with Apache License 2.0
from garyxiong123

/**
 * @Author: xiongchengwei
 * @Date: 2019/10/9 上午9:44
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public clreplaced BaseEnreplacedy {

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

    @CreatedBy
    private String createAuthor;

    @CreatedDate
    private LocalDateTime createTime;

    @LastModifiedBy
    private String updateAuthor;

    @LastModifiedDate
    private LocalDateTime updateTime;

    public BaseEnreplacedy(Long id) {
        this.id = id;
    }
}

16 Source : Upload.java
with MIT License
from auntvt

/**
 * @author 小懒虫
 * @date 2018/11/02
 */
@Enreplacedy
@Table(name = "sys_file")
@Data
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public clreplaced Upload implements Serializable {

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

    /**
     * 文件名
     */
    private String name;

    /**
     * 文件路径
     */
    private String path;

    /**
     * 文件类型
     */
    private String mime;

    /**
     * 文件大小
     */
    private Long size;

    /**
     * 文件md5值
     */
    private String md5;

    /**
     * 文件sha1值
     */
    private String sha1;

    /**
     * 创建时间
     */
    @CreatedDate
    private Date createDate;

    /**
     * 创建者
     */
    @CreatedBy
    @ManyToOne(fetch = FetchType.LAZY)
    @NotFound(action = NotFoundAction.IGNORE)
    @JoinColumn(name = "create_by")
    @JsonIgnore
    private User createBy;

    /**
     * 获取文件绝对路径
     */
    public String getUrl() {
        HttpServletRequest request = HttpServletUtil.getRequest();
        if (!StringUtils.isEmpty(path)) {
            StringBuffer url = request.getRequestURL();
            String baseUrl = url.delete(url.length() - request.getRequestURI().length(), url.length()).append(request.getContextPath()).toString();
            return baseUrl + path;
        }
        return path;
    }
}

16 Source : BaseAuditableEntity.java
with Apache License 2.0
from arohou

/**
 * A base {@link javax.persistence.Enreplacedy} with fields for audit.
 *
 * @author Cezary Krzyżanowski on 28.07.2017.
 * @see http://www.baeldung.com/database-auditing-jpa
 */
@Data
@NoArgsConstructor
@EqualsAndHashCode(of = {}, callSuper = true)
@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public abstract clreplaced BaseAuditableEnreplacedy extends BaseLockingEnreplacedy {

    @CreatedDate
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "created_date", nullable = false, updatable = false)
    private Date createdDate;

    @LastModifiedDate
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "modified_date")
    private Date modifiedDate;

    @Column(name = "created_by")
    @CreatedBy
    private String createdBy;

    @Column(name = "modified_by")
    @LastModifiedBy
    private String modifiedBy;

    public BaseAuditableEnreplacedy(Long id, Integer version, Date createdDate, Date modifiedDate, String createdBy, String modifiedBy) {
        super(id, version);
        this.createdDate = createdDate;
        this.modifiedDate = modifiedDate;
        this.createdBy = createdBy;
        this.modifiedBy = modifiedBy;
    }

    public BaseAuditableEnreplacedy(final BaseAuditableEnreplacedy other) {
        super(other);
        this.createdDate = other.createdDate;
        this.modifiedDate = other.modifiedDate;
        this.createdBy = other.createdBy;
        this.modifiedBy = other.modifiedBy;
    }
}

16 Source : SimpleAuditingModel.java
with GNU Lesser General Public License v2.1
from abixen

@MappedSuperclreplaced
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public abstract clreplaced SimpleAuditingModel extends Model {

    @CreatedBy
    @Column(name = "created_by_id")
    private Long createdById;

    @CreatedDate
    @Column(name = "created_date")
    private Date createdDate;

    @LastModifiedBy
    @Column(name = "last_modified_by_id")
    private Long lastModifiedById;

    @LastModifiedDate
    @Column(name = "last_modified_date")
    private Date lastModifiedDate;

    public abstract Long getId();

    public Long getCreatedById() {
        return createdById;
    }

    public void setCreatedById(Long createdById) {
        this.createdById = createdById;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    public Long getLastModifiedById() {
        return lastModifiedById;
    }

    public void setLastModifiedById(Long lastModifiedById) {
        this.lastModifiedById = lastModifiedById;
    }

    public Date getLastModifiedDate() {
        return lastModifiedDate;
    }

    public void setLastModifiedDate(Date lastModifiedDate) {
        this.lastModifiedDate = lastModifiedDate;
    }

    @Override
    public String toString() {
        StringBuilder result = new StringBuilder();
        String newLine = System.getProperty("line.separator");
        result.append(this.getClreplaced().getName());
        result.append(newLine);
        result.append("Object {");
        result.append(newLine);
        Field[] fields = this.getClreplaced().getDeclaredFields();
        AccessibleObject.setAccessible(fields, true);
        for (Field field : fields) {
            if (!Modifier.isStatic(field.getModifiers())) {
                result.append("    ");
                try {
                    result.append(field.getName());
                    result.append(": ");
                    // requires access to private field
                    result.append(field.get(this));
                } catch (IllegalAccessException e) {
                    e.printStackTrace();
                }
                result.append(newLine);
            }
        }
        result.append("    createdById: ");
        result.append(getCreatedById());
        result.append(newLine);
        result.append("    createdDate: ");
        result.append(getCreatedDate());
        result.append(newLine);
        result.append("    lastModifiedById: ");
        result.append(getLastModifiedById());
        result.append(newLine);
        result.append("    lastModifiedDate: ");
        result.append(getLastModifiedDate());
        result.append(newLine);
        result.append("}");
        return result.toString();
    }
}

15 Source : Message.java
with Apache License 2.0
from linnykoleh

@Enreplacedy
@AllArgsConstructor
@NoArgsConstructor
@Data
@EnreplacedyListeners(AuditingEnreplacedyListener.clreplaced)
public clreplaced Message {

    @Id
    @GeneratedValue
    private Long id;

    private String text;

    @OneToOne
    private User to;

    @CreatedBy
    private String createdBy;

    @CreatedDate
    @Temporal(TemporalType.TIMESTAMP)
    private Date created;

    public Message(String text, User to) {
        this.text = text;
        this.to = to;
    }
}

See More Examples