Closed tio-plato closed 3 years ago
Looks like the content links processor - that adds content links to spring data responses - is assuming that @Id annotated fields will have getters.
You can probably workaround this by adding a getter for the time being but I can investigate how Spring Data REST access the id field in this instance. Or maybe it just doesn't because it is supplied in the URL.
I just found out that using @Data
annotation in child class doesn't add getter and setter to parent class properties. l was thinking that my parent class properties have getter. after I added @Getter
annotation to BaseEntity everything is back to normal. Maybe spring data jpa and spring data rest don't access the id via getter, so I never caught the error before. Thank you for your patience!
I have a project that uses
spring data rest
and I found that after addingspring-content-rest-boot-starter
to my project, calling any restful api will cause the exception:I tested and found that this only happens when the Entity extends a superclass and uses the @Table and @Column annotations in the Entity.
BaseEntity:
User:
Maybe useful: my pom.xml