I have an entity which has a property that does not get its value from the entity's table. But it could be calculated by a query if it is possible.
To clarify, I have an entity of an Entry and I want to check if the current user voted it or not. So for that reason I thought that I could add a property like "IsCurrentUserVoted" to the Entry entity. And if it is possible to bind its value from a query like "select count(*) from vote where userId = :currentUser
".
I wonder if nhibernate supports this kind of a feature or it is the only way to join the vote and entry tables? If it does not, what would your solution be in that case.
Thanks in advance.