Hi there. I am getting up to speed with Spring RE...
# spring
j
Hi there. I am getting up to speed with Spring REST and I noticed that my id field is being appended to the end of the self URI. This is exposing an internal id which is bad practice. How do I designate the userName field as also being unique, and that is the field that should be appended to the URI? Thanks.
Copy code
@Entity
data class User(
        @Id
        @GeneratedValue(strategy = GenerationType.AUTO)
        val id: Long,
        val userName: String)
This seems to be the answer; either encrypt the id or store it separately: http://stackoverflow.com/questions/5750122/restful-api-hiding-hibernate-id-and-version