Skip to content

Add Projections.Conditional for CASE expressions with multiple conditions #2816

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

Merged
merged 5 commits into from
Jun 15, 2021

Conversation

perahoky
Copy link
Contributor

@perahoky perahoky commented Jun 9, 2021

Fixes #2804

Not sure whether the testing is alright. I simply put MSSQLLocalDb or SQLite-InMemory for local testing.
Hope its okay.

Creates a "switch" expression with multiple "when then" parts.
For example:

select this_.Name, this_.Enum from Examples order by case ( when this_Enum = "EnumValueEnglish" then 1, when this_Enum = "EnumValueGerman" then 2, when this_Enum = "EnumValueFrance" then 3 else 99)

have a nice day.
Pera

…h multiple Criterias/Projections (when/thens)
@hazzik
Copy link
Member

hazzik commented Jun 9, 2021

The following classes was expected to be marked as Serializable:
NHibernate.Criterion.ConditionalsProjection

@perahoky
Copy link
Contributor Author

Thank you hazzik :)

@hazzik hazzik changed the title Add Criteria.ConditionalsProjection for "switch-case" expressions with multiple "cases/whens" (projections) Add Projections.Conditional for "switch-case" expressions with multiple "cases/whens" (projections) Jun 11, 2021
@hazzik
Copy link
Member

hazzik commented Jun 11, 2021

We also need feature parity from QueryOver It is not used in QueryOver

@hazzik hazzik changed the title Add Projections.Conditional for "switch-case" expressions with multiple "cases/whens" (projections) Add Projections.Conditional for CASE expressions with multiple conditions Jun 12, 2021
@hazzik hazzik added the t: Fix label Jun 12, 2021
@hazzik hazzik merged commit e9f43d6 into nhibernate:master Jun 15, 2021
@hazzik hazzik added this to the next minor milestone Jun 15, 2021
@fredericDelaporte fredericDelaporte removed their request for review August 7, 2021 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Projections.Conditional for CASE expressions with multiple conditions
3 participants