I have below code
@Embedabble
public class key {
@Id
private String id;
@Id
private String Name;
//getters setters
}
@Entity
public class Information {
@EmbeddedId
private Key key;
//Getters and setters
}
public class Service {
@Autowired
private Information information;
public inforamtionResponse service() {
List<Information> infot = repo.getInformation();
}
}
I want to store infot in map form such as id as key and name as value. using java 8 stream how can I do that?
I tired using java8 stream but unable fetch object from object.