All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.feingto.cloud.domain.IdEntity Maven / Gradle / Ivy

There is a newer version: 2.3.8.RELEASE
Show newest version
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