I have an Entity MemberBank, which is joined to another Entity AppUser by a column name updatedBy.
Now AppUser is a very heavy Model in our system, but for MemberBank I only need name information from that entity, how do map it to load only specific fields.
Here's the mapping ?
@ManyToOne(cascade = CascadeType.REFRESH)
@JoinColumn(name = "UPDATED_BY")
public AppUserModel getUpdatedByAppUserModel() {
return updatedByAppUserModel;
}
Currently it loads the whole model, I only want it loaded for 2 3 fields, like name, id, address etc.
And just like updatedBy, it also have a field createdBy, so I have to cater both getters.
Regards.