I have a java class that as the id has an object that holds the actual id value. How can I use Spring Data MongoDB for id generation and identification, and how to define the MongoDB repository?
Example:
@Document
class A {
@Id
private B id;
}
class B{
private String id;
private String idAppGenerator;
}
This throws exception due to the fact that Spring can't autogenerate value for B class.