Last active
April 21, 2019 03:06
-
-
Save BrunoDSouza/24fd51ac82f0ab507dfdb96aa2c4fec7 to your computer and use it in GitHub Desktop.
Mapping abstract entity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.zieg.ApplicationManager; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.data.jpa.repository.config.EnableJpaAuditing; | |
@EnableJpaAuditing | |
@SpringBootApplication | |
public class ApplicationManager { | |
public static void main(String[] args) { | |
SpringApplication.run(ApplicationManager.class, args); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.zieg.ApplicationManager.Model.Base; | |
import org.springframework.data.annotation.CreatedDate; | |
import org.springframework.data.annotation.LastModifiedDate; | |
import javax.persistence.GeneratedValue; | |
import javax.persistence.GenerationType; | |
import javax.persistence.Id; | |
import java.util.Date; | |
public abstract class EntidadeBase { | |
@Id | |
@GeneratedValue(strategy = GenerationType.IDENTITY) | |
private long id; | |
private boolean inativo; | |
@CreatedDate | |
private Date createdDate; | |
@LastModifiedDate | |
private Date lastmodifiedDate; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.zieg.ApplicationManager.Model; | |
import com.zieg.ApplicationManager.Model.Base.EntidadeBase; | |
import lombok.*; | |
import org.springframework.lang.Nullable; | |
import javax.persistence.*; | |
import java.util.List; | |
@Data | |
@EqualsAndHashCode(callSuper = false) | |
@NoArgsConstructor | |
@AllArgsConstructor | |
@Builder | |
@Entity | |
@Table | |
public class Parametro extends EntidadeBase { | |
private String nome; | |
private String descricao; | |
private float vl_max; | |
private float vl_min; | |
private float vl_default; | |
@Nullable | |
private float value; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment