Reputation: 41
I am starting to build a REST API with spring data rest but the JSON object returned in my first testing does not return the column names and just returns the links to the objects.
ENTITY:
@Data
@Entity
public class Employee {
private @Id @GeneratedValue Long id;
private String name;
private String email;
private Employee() {}
public Employee(String name, String email) {
this.name = name;
this.email = email;
}
}
REPOSITORY:
public interface EmployeeRepository extends CrudRepository<Employee, Long>{
}
REQUEST / RESPONSE:
I tried to remove the lombok @Data since I read it in a similar post but it didnt work. I´m using MySQL as database.
Thanks in advance!
Upvotes: 1
Views: 165
Reputation: 41
Okay guys, I solved the problems by creating getters and setter manually. If anyone knows how to be able to use Lombok please share with all:).
Upvotes: 1