问题
Is it possible to mark field of the class that it will be lazy-loaded?
Example:
public class Dictionary {
private String id;
private String someDescription;
private String someInfo;
private Map<String, String> dictionary;
}
I want to mark "dictionary" field to be lazy-accessed. Why? This field can be huge and I need it only sometimes, not always. For example I have another object that contains a lot of Dictionary. And its main purpose is to present information from all contained Dictionaries (we need only someDescription, someInfo and so on, not playload) and than if needed we can get "dictionary" filed if it's needed.
来源:https://stackoverflow.com/questions/48927301/spring-data-mongodb-lazy-access-to-some-fields