@Document("scenarios")
public class Scenario {
@Id
private String id;
@Indexed(unique = true)
private String name;
private String description;
@JsonSerialize(using = PlatformSerializer.class)
private final List<Platform> platforms;
// getters and setters not shown
public class Platform {
private final PlatformData platformData;
@JsonSerialize(using = RowSerializer.class)
private final List<Row> rows;
// getters and setters not shown
The scenarios collection contains the embedded Platform objects. When I get the Scenario object from the database using the ScenarioRepository object shown below, the name and description values are correct. However, the platforms List is empty. I seem to recall that containers require an annotation. Though the Scenario object was saved to the database just fine. What the hell am I missing? Thanks!
@Repository
public interface ScenarioRepository extends MongoRepository<Scenario, String> {
Scenario findByName(String name);
}
```*emphasized text*