Open mzgg opened 4 years ago
Hi! I think the easiest way is to create another entity, with only necessary fields:
@Entity
public class UserSummary {
private String id;
private String name;
}
And to search on this entity, instead of the full User
.
Hi! I think the easiest way is to create another entity, with only necessary fields:
@Entity public class UserSummary { private String id; private String name; }
And to search on this entity, instead of the full
User
.
Hello, this is definitely a neat approach but can you suggest in case we need the dynamic columns from query at runtime Meaning, we only know the columns at runtime to be fetched. In this case creating another entity is not an option Can we use criteriaQuery.multiselect with the rest of you plugin? Because this is very well made plugin, just need to add this specific requirement.
Thanks in advance
@MariumHashmiBM That's a good question! I'm not sure that's feasible with criteriaQuery.multiselect
, as it requires that the entity provides a constructor with the selected fields. Also, I don't think @Transient
annotations can be added at runtime.
I'm open to suggestion on this, if you find anything.
Note: the logic for the creation of the specification is here.
Hello, I have entity that is have many relational field. I want show to 2 column in frontend, but findAll methods is getting all columns, I don't want execute the joining their relational table