Hello,
I am trying to manually use the IQueryTranslator to translate a simple HQL to SQL.
Code:
string hql = "from " + typeof(T).Name;
IQueryTranslator translator = translatorFactory.CreateQueryTranslator(hql, new Hashtable(), _mySessionFactoryImplementor);
translator.Compile(new Hashtable(), true);
string sql = translator.SQLString;
The mapping xml
Code:
<class name="Item" table="Items">
<id name="ItemId" type="Guid">
<generator class="guid"/>
</id>
</class>
The was expecting something like "select * from Items"
Instead the string returned is "select item0_.ItemId as x0_0_ from Items item0_"
Is this normal or am I doing something wrong here?
In the same class when I use
Code:
CreateQuery("from " + typeof(T).Name);
all is working fine, so the mapping shouldnt be the problem.
Any help is much apprecheated.
Cheers,
Michael