Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring Data Rest returns 404 on camel case properties. [DATAREST-1526] #1882

Open
spring-projects-issues opened this issue Jun 1, 2020 · 0 comments
Assignees
Labels

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Jun 1, 2020

Alexander opened DATAREST-1526 and commented

I have these two classes:

@Entity
data class Form(

        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        val id: Long? = null,

       
        @ManyToOne
        @JoinColumn(name = "child_id")
        val child: Child,
)

@Entity
data class Child(

        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        val id: Long? = null,

        val name: String,
)

http://localhost:8080/forms/1

gives me

 

{   "id":1,
   "_links":{      "self":{         "href":"http://localhost:8080/forms/1"
      },
      "form":{         "href":"http://localhost:8080/forms/1"
      },
      "child":{         "href":"http://localhost:8080/forms/1/child"
      }
   }
}

http://localhost:8080/forms/1/child works fine as well.

But if I change child property to childEntity like this:

 

 

@Entity data class Form( 
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) 
val id: Long? = null, 

@ManyToOne @JoinColumn(name = "child_id") 
val childEntity: Child 
)

then 

 

http://localhost:8080/forms/1/childEntity returns 404. Actually, tried a lot and with @RestResource as well and everything is not working.

 

Errors in logs:

org.springframework.data.rest.webmvc.ResourceNotFoundException: EntityRepresentationModel not found

Affects: 3.2.7 (Moore SR7), 3.3 GA (Neumann)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants