I am using Fluent NHibernate to query my Oracle 11g database. In the fluent mapping files I have a Mapping which looks like that
Map(x => x.WaterLevel).Formula("CAST(WATER_LEVEL AS DOUBLE PRECISION )")
However, when I run my tests I get
Oracle.DataAccess.Client.OracleException : ORA-00907: missing right parenthesis
Due to additional strings (this_.) in the SQL translation:
CAST(this_.WATER_LEVEL AS this_.DOUBLE this_.PRECISION )
I have referred to How can you stop NHibernate (via ActiveRecord) adding this_. to a table name in a formula and How can I stop NHibernate adding "or this._property is null" to generated queries? but the solutions suggested did not work for me.