Hey,
Can anyone shed some light on how to use business logic Properties in a HQL Query.
Example
Code:
Car Object
Color Property (.hbm mapped)
PlateNumber Property (.hbm mapped)
State Property (Derived Business Logic Property)
The first two properties are simply table field lookups however the State Property is not mapped in the .hbm file it is instead a container for derived logic. Depending on the first 2 numbers of the PlateNumber determines the state that it comes from. (forgive the bad example, state should be stored on create)
What I want to achieve is to be able to use the State Property in a HQL Query for example.
Code:
From Car c where c.State = 'AK'
NHibernate doesn't seem to like this as State is not a mapped attribute. I can understand why this is the case as this can not be converted in to a SQL query of any type but would be might useful in attempting to better centralize business logic in model objects.
Can someone please advise?
Thanks, Adam