Skip to content

Invalid parameter conversion for enums #2439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
emejibka opened this issue Jul 21, 2020 · 1 comment · Fixed by #2443
Closed

Invalid parameter conversion for enums #2439

emejibka opened this issue Jul 21, 2020 · 1 comment · Fixed by #2443

Comments

@emejibka
Copy link

emejibka commented Jul 21, 2020

Test case
https://github.com/emejibka/nhibernate-fetch-bug/blob/master/TestClass.cs

Insert
INSERT INTO "Product" (Category, Customer_id) VALUES (@p0, @p1); select last_insert_rowid();@p0 = 'SomeCategory' [Type: String (0:0:0)], @p1 = 1 [Type: Int64 (0:0:0)]

Select with fetch
select cast(count(*) as INTEGER) as col_0_0_ from "Product" product0_ where product0_.Category=@p0;@p0 = 1 [Type: Int32 (0:0:0)]

Select without fetch
select cast(count(*) as INTEGER) as col_0_0_ from "Product" product0_ where product0_.Category=@p0;@p0 = 'SomeCategory' [Type: String (0:0:0)]

Why the text enum value is replaced with an integer?

It happens with NH 5.3. 5.2.7 work without issue.

@fredericDelaporte fredericDelaporte changed the title NHibernate 5.3 Invalid query generation Invalid parameter conversion for enums Jul 21, 2020
@fredericDelaporte fredericDelaporte added this to the 5.3.1 milestone Jul 21, 2020
@hazzik
Copy link
Member

hazzik commented Jul 22, 2020

Fixed by #2443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants