Skip to content

Commit

Permalink
Remove unnecessary fields from students json.
Browse files Browse the repository at this point in the history
  • Loading branch information
GustavoDinizMonteiro committed Oct 29, 2018
1 parent 618730d commit 1b21a1c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@

<!-- https://mvnrepository.com/artifact/org.projectlombok/lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.22</version>
<scope>provided</scope>
</dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.22</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>io.jsonwebtoken</groupId>
Expand Down
14 changes: 6 additions & 8 deletions src/main/java/quem/me/ajuda/models/Student.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package quem.me.ajuda.models;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
Expand All @@ -19,12 +20,8 @@
@Getter @Setter
@EqualsAndHashCode(of = {"registration"})
@NoArgsConstructor
public class Student implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;

@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"}) // Lombok in probably creating gets/sets for internal properties of string
public class Student {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(nullable = false, unique = true)
Expand All @@ -39,6 +36,7 @@ public class Student implements Serializable {
@Column(nullable = false, unique = true)
private String email;

@JsonIgnore
@Column(nullable = false)
private String password;

Expand Down
5 changes: 1 addition & 4 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
spring.datasource.url= jdbc:postgresql://localhost:5432/meajuda
spring.datasource.username=meajuda
spring.datasource.password=meajuda
spring.jpa.hibernate.ddl-auto=create-drop

spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults = false
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL9Dialect
spring.jpa.hibernate.ddl-auto=update

0 comments on commit 1b21a1c

Please sign in to comment.