How recently did you update?
Properties can have multiple columns and it was ambiguous whether you were
setting the name or adding an extra one, I've since updated the code to make
it a bit clearer. If I remember correctly your Apply should contain:
target.ColumnNames.Clear(); // make sure there a
I figured out what caused it, but I am still stuck
Some of my properties happens to be reserved words in the database. So
in my ClassMap, I explicitely declare them like this:
Map(x => x.Column)
.ColumnName("COLUMN_NAME");
I need to be able to explicitly call ColumnName in my ClassMaps
I forget the number, but it was from yesterday. I will try to rewrite
considering what you just posted. (our posts crossed)
On Mar 14, 9:16 am, James Gregory wrote:
> How recently did you update?
> Properties can have multiple columns and it was ambiguous whether you were
> setting the name or a
I got it working, but the code does not feel right. The code in my
Apply method is what really bugs me.
In my class map, I now need to do the following..
Map(x => x.Column, "COLUMN_NAME")
And in my IPropertyConvention I need to do this
public void Apply(IProperty target)
If your column names are sometimes reserved words, you can wrap them in
backticks. So you could remove the explicit column name from the Map call
and modify your convention to do: "`" +
target.Property.Name.ToUpperCaseUnderscore()
+ "`"
That will make NHibernate escape the column names in any queri
Thanks. That tidbit will proove useful. But I still think that
there should be a clean way of making the IPropertyConvention only
apply if I've not already explicitly specified a column name.
On Mar 14, 9:58 am, James Gregory wrote:
> If your column names are sometimes reserved words, you ca
What's wrong with this:
public bool Accept(IProperty target)
{
return (target.ColumnNames.List().Count == 0);
}
On Sat, Mar 14, 2009 at 5:15 PM, JohnRudolfLewis wrote:
>
> Thanks. That tidbit will proove useful. But I still think that
> there should be a clean way of making the IPropertyCon
Duh... Thanks.
On Mar 14, 10:17 am, James Gregory wrote:
> What's wrong with this:
> public bool Accept(IProperty target)
> {
> return (target.ColumnNames.List().Count == 0);
>
> }
>
> On Sat, Mar 14, 2009 at 5:15 PM, JohnRudolfLewis wrote:
>
>
>
>
>
> > Thanks. That tidbit will proove useful.
No problem :)
On Sat, Mar 14, 2009 at 5:32 PM, JohnRudolfLewis wrote:
>
> Duh... Thanks.
>
> On Mar 14, 10:17 am, James Gregory wrote:
> > What's wrong with this:
> > public bool Accept(IProperty target)
> > {
> > return (target.ColumnNames.List().Count == 0);
> >
> > }
> >
> > On Sat, Mar 14,