Won't Fix
Details
Details
Assignee
Unassigned
UnassignedReporter
Steinar Dragsnes
Steinar DragsnesComponents
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created April 3, 2009 at 2:42 AM
Updated September 10, 2010 at 1:20 AM
Resolved October 22, 2009 at 4:59 PM
Looking at the implementation of FilterDefAttribute, then it is obvoius that the attribute cannot be used outside the class context, which documentation specifies is how a FilterDef should be declared:
.....
[System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field, AllowMultiple=true)]
[System.Serializable()]
public class FilterDefAttribute : BaseAttribute
.....
When placing the FilterDefAttribute elsewhere then on properties, you will get compile errors. When placed on a property, it will not be picked up by the HbmWriter.
The AttributeTargets.Class should at least be specified and then the HbmWriter must be responsible for placing the produced filter-def xml tag after the specification of the table mapping. Test that the FitlerDefAttribute work as expected, check if this behaviour exists in the upcoming NH2.1 release. Should be fixed there as well.