Skip to content
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

Regression bug with enums used as parameter for string column #2621

Closed
csharper2010 opened this issue Nov 25, 2020 · 2 comments · Fixed by #2622
Closed

Regression bug with enums used as parameter for string column #2621

csharper2010 opened this issue Nov 25, 2020 · 2 comments · Fixed by #2622

Comments

@csharper2010
Copy link
Contributor

csharper2010 commented Nov 25, 2020

It used to be possible to provide an enum as a parameter for HQL queries where a criterion using that parameter matches on a string column.

I know that there are different options to have an enum directly in the property and map it to a string column on the database but sometimes there just might be the convention to use an enum for defining the possible values of a string column.

I would generally argue that enums should be treated like strings when mapped on string columns.

csharper2010 pushed a commit to csharper2010/nhibernate-core that referenced this issue Nov 25, 2020
Special treatment of enums mapped on string columns because all reasons
for checking string lengths or streamlining the length of parameters of
queries on string columns to the length of the column for SQL Server
are also valid for enums because they are sometimes by convention used
to model the possible values of a string column
@hazzik
Copy link
Member

hazzik commented Nov 30, 2020

This looks like an user error. I'll be willing to accept a less invasive changes.

@fredericDelaporte
Copy link
Member

fredericDelaporte commented Dec 13, 2020

It used to be possible to provide an enum as a parameter for HQL queries where a criterion using that parameter matches on a string column.

Your wording implies it was previously possible but is no more. Have you more information on this? In which version this would have ceased working, in which version was it working?
I would like to clarify from which version a regression would have occurred on this subject.

csharper2010 pushed a commit to csharper2010/nhibernate-core that referenced this issue Dec 14, 2020
Special treatment of enums mapped on string columns because all reasons
for checking string lengths or streamlining the length of parameters of
queries on string columns to the length of the column for SQL Server
are also valid for enums because they are sometimes by convention used
to model the possible values of a string column
csharper2010 pushed a commit to csharper2010/nhibernate-core that referenced this issue Dec 14, 2020
Special treatment of enums mapped on string columns because all reasons
for checking string lengths or streamlining the length of parameters of
queries on string columns to the length of the column for SQL Server
are also valid for enums because they are sometimes by convention used
to model the possible values of a string column
@fredericDelaporte fredericDelaporte added this to the next minor milestone Feb 14, 2022
hazzik pushed a commit to csharper2010/nhibernate-core that referenced this issue Sep 8, 2022
Special treatment of enums mapped on string columns because all reasons
for checking string lengths or streamlining the length of parameters of
queries on string columns to the length of the column for SQL Server
are also valid for enums because they are sometimes by convention used
to model the possible values of a string column
hazzik pushed a commit that referenced this issue Oct 31, 2022
Special treatment of enums mapped on string columns because all reasons
for checking string lengths or streamlining the length of parameters of
queries on string columns to the length of the column for SQL Server
are also valid for enums because they are sometimes by convention used
to model the possible values of a string column

* Fixes #2621
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