[Prev] Thread [Next]  |  [Prev] Date [Next]

[fluent-nhib] Formula Question Dru Sellers Fri Apr 06 04:00:38 2012

I have a property mapped like so:

    //id = 'Subsector_id'
    //className = Subsector
            Map(x => x.TranslatedDescription).Formula(@"(SELECT trans.value
FROM Translations AS trans
WHERE trans.item_id = {0} AND trans.language_id = :Language.Id AND
trans.class_name='{1}')".FormatWith(id, className));

That is generating the hbm.xml

    <property name="TranslatedDescription" formula="(SELECT trans.value
FROM Translations AS trans&#xD;&#xA;WHERE trans.item_id = Subsector_Id AND
trans.language_id = :Language.Id AND trans.class_name='Subsector')"
type="System.String, mscorlib, Version=, Culture=neutral,
      <column name="translated_description" />

Should the column name exist? My guess is I have a convention that is
jacking this up maybe?

It might be this one?
        Regex _camel = new Regex("([a-z])([A-Z])");
        public void Apply(IPropertyInstance instance)
            var name = _camel.Replace(instance.Property.Name,

should i be checking for the existence of formula?


You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To post to this group, send email to [EMAIL PROTECTED]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at