I've got an object that represents an Artefact:
public class Artifact {
private final URI location;
public Artifact(URI location) {
this.location = location;
}
}
When I use MongoTemplate
to save this, the URI gets turned into an object:
{ "location" : { "scheme" : "http", "authority" : "localhost:8080", "host" : "localhost", "port" : 8080, "path" : "/testFrontendURL", "schemeSpecificPart" : "//localhost:8080/testFrontendURL", "hash" : 331612143, "string" : "http://localhost:8080/testFrontendURL" }
But, this could just be represented by the URI string:
{"location": "http://localhost:8080/testFrontendURL"}
How can I configure Spring Data to do this?