Example:
I have an Book entity. it has
class Book {
String id;
String author;
int price;
Date manufacturingDate;
.
.
.
}
when I am trying to query using Projections.include(id, author). It gives me entire Book object with id and author intitialized and other fields set to null.
(Actual Problem)
- this is acceptable when we know the entities we are dealing with. But if I had to make it dynamic we dont know which all fields did we fetched with.
- It increases the over head of handling objects and accessing data. Which can solved by returning Document / Json.
Example:
I have an Book entity. it has
class Book {
String id;
String author;
int price;
Date manufacturingDate;
.
.
.
}
when I am trying to query using Projections.include(id, author). It gives me entire Book object with id and author intitialized and other fields set to null.
(Actual Problem)