package apolo.data.model.base;

import javax.persistence.*;
import java.io.Serializable;

@MappedSuperclass
public abstract class BaseEntity<ID extends Serializable> implements Serializable {

	private static final long serialVersionUID = 1L;
	
	@Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "ID", nullable = false)
    private ID id;

    public ID getId() {
        return id;
    }

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

    @Transient
    public Boolean isPersisted() {
        return this.getId() != null;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }

        if (obj == null || (this.getClass() != obj.getClass())) {
            return false;
        }

        BaseEntity<?> other = (BaseEntity<?>) obj;

        if (this.getId() == null && other.getId() == null) {
            return false;
        } else if (this.getId() == null && other.getId() != null) {
            return false;
        } else if (!this.getId().equals(other.getId())) {
            return false;
        }

        return true;
    }
}

@@ -186,17 +186,20 @@
 able %7B%0A%0A
-%09
+    
 private 
@@ -243,11 +243,13 @@
 1L;%0A
-%09%0A%09
+%0A    
 @Id%0A
@@ -355,18 +355,20 @@
 private 
-ID
+Long
  id;%0A%0A  
@@ -376,18 +376,20 @@
  public 
-ID
+Long
  getId()
@@ -439,18 +439,20 @@
 d setId(
-ID
+Long
  id) %7B%0A 

ajuste em baseentity