com.feingto.cloud.domain.IdEntity Maven / Gradle / Ivy
package com.feingto.cloud.domain;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.*;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
/**
* ID 基类
*
* @author longfei
*/
@Setter
@Getter
@NoArgsConstructor
@AllArgsConstructor(access = AccessLevel.PROTECTED)
@MappedSuperclass
public class IdEntity extends CloneableBase {
@Id
@GenericGenerator(name = "uuid", strategy = "uuid2")
@GeneratedValue(generator = "uuid")
@Column(unique = true, nullable = false)
protected String id;
@JsonIgnore
@Transient
public boolean isNew() {
return null == this.getId();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy