I'm seeing an exception and I don't know if I should submit a bug for it.
I have the following mapping:
Code:
<?xml version="1.0"?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"
assembly="Eg" namespace="Eg"
default-lazy="false">
<class name="FactoryInfo" table="FactoryInfos">
<id name="Id">
<generator class="guid.comb"/>
</id>
<property name="Name" column="`Name`" length="64" not-null="true" />
<property name="Description" length="256" not-null="true" />
<property name="ObjectType" not-null="true" />
</class>
</hibernate-mapping>
The 'ObjectType' property is a Type, using the hbm2ddl SchemaExport class, that column in the table gets created as an nvarchar(255). But when I try to issue the following query and turn on SQL Logging, it generates a query where the objectType parameter is passed as a byte array:
Code:
public FactoryInfo GetFactoryInfo(Type objectType)
{
IQuery query = CreateQuery("FROM FactoryInfo AS fi WHERE fi.ObjectType = :objectType");
query.SetParameter("objectType", objectType);
return query.UniqueResult() as FactoryInfo;
}
I can switch the SetParameter call to use objectType.AssemblyQualifiedName and that works, but shouldn't HQL generate the correct query for Types it knows how to map?