I have a mapping that retrieves all active roles for a user. I use the where attribute to filter out roles in the hbm mapping. The mapping look like this:
<map name="Bar" table="Foo_Bar" lazy="true" cascade="all" inverse="false" where="intGroupId Is Null And dtmExpires > getdate()">
<cache usage="read-write"/>
<key column="intUserId"/>
<index column="varRole" type="string"/>
<one-to-many class="Foo.Bar, Foo"/>
</map>
This works great in production on a SQL Server, but in my unit tests where I use SQLite the getdate() function isn't recognized.
How can I modify my mapping so it works in both MS SQL Server and SQLite, but still have the filter?
// Johan