Skip to content

designreuse/best-practices-1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 

Repository files navigation

Best Practices - (PostgreSQL / Java / Spring / Hibernate)

Some best practices that are useful in this stack.

Contents:

PostgreSQL

  2004-10-19 10:23:54+02

Java

Spring / Hibernate

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

All the annotations above are important for the definition of the sequence otherwise it won't work, including the allocationSize. If you don't define the allocationSize the id value might go negative or collisions might happen.

Security

REST

  @JsonProperty("id")
  private Integer recordId;

  @JsonProperty("user_id")
  private Integer userId;
	
  @JsonProperty("air_temp")
  private Double airTemp;
	
  @JsonProperty("rel_temp")
  private Double relTemp;	

Git

Other

Stack

* Windows 10
* PostgreSQL 10.2
* Java 9
* Spring Boot 2.0.0
* Gradle 4.6
* Eclipse Oxygen.2
* DBeaver
* Git 2.16

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published