views:

225

answers:

1

I have a class which I want to add a property with using formula attribute.

Here is the mapping that I use in mapping file.

<property name="CurrentUserVote" type="Climate.Domain.Vote, Climate.Domain" formula="(select v from Vote v where v.AchievementId=Id and (v.IP=:CurrentUserVoteFilter.CurrentUserIP))"></property>

As you see, I want this property to be an object which refers to class that already has an nhibernate mapping. But this mapping gives a mapping exception;

Could not determine type for: Climate.Domain.Vote, Climate.Domain, for columns: NHibernate.Mapping.Formula( (select v from Vote v where v.AchievementId=Id and (v.IP=:CurrentUserVoteFilter.CurrentUserIP)) )

Is it possible to map a property with formula attribute to a class?

Thanks in advance.

+2  A: 

The property type must be a IUserType. See

Mauricio Scheffer
I'll check this out and inform you. Thank you for your response.
yapiskan