Probably it need a modification in the NHibernate.Driver.NpgsqlDriveror,
even better a specific NHibernate.Driver.NpgsqlDriver2
The method to override is
IDbCommand GenerateCommand(...)
there you can change the parameter size using 'SqlType[] parameterTypes' (a
parameter of GenerateCommand).

Please create a new JIRA about this problem (without a link to this
thread) specifying all thing you think is relevant to fix it.

If you have time to write and test it let me know (ping me in private mail)
and I can guide you to implement it.


2009/6/8 Paul <[email protected]>

>
> Hello guys...
> I have a PK (character (10)), that is mapped like that:
>
> <id name="ID" type="String">
>      <generator class="assigned"/>
> </id>
>
> The load works fine with npgsql 1.0, the sql generated with loadbyid
> is :
> SELECT city0_."IDCity" as IDMu1_92_0_ FROM "tblCity" city0_ WHERE
> city0_."IDCity"=E'BR420240'
>
> Using npgsql 2.0. the sql generated is :
> SELECT city0_."IDCity" as IDMu1_92_0_ FROM "tblCity" city0_ WHERE
> city0_."IDCity"='BR420240'::text
>
> So, I got ObjectNotFoundException, because that SQL returns 0
> results...
>
> Npgsql developer told-me to specify the exact type to the PK, in that
> case : character(10)...
>
> How can I do that using NH? I tried use sql-type, but I think it only
> exist in Hibernate...
>
> Thanks
> >
>


-- 
Fabio Maulo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" 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 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to