Skip to content

Regression caused by NH-3904 #547

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
wants to merge 1 commit into from
Closed

Conversation

gliljas
Copy link
Member

@gliljas gliljas commented Jan 9, 2017

Just a suggestion. Please advise.

@hazzik
Copy link
Member

hazzik commented Jan 9, 2017

Some options here:

  1. fast & easy solution: rollback this heuristic to get custom type and force user to use .MappedAs() extension method (NH-2401/NH-2401 - A method to specify IType of LINQ parameter #421, also in 4.1) .
  2. properly implement GuessType (see AbstractQueryImpl.GuessType to get the idea). But this solution will still have some flaws as sometimes the wrong type will be picked anyway.
  3. same as above, but also analyse surrounding expression to get the idea about constant expression true type (similar to NH-3403: Wrong parameter size in query with MsSql2000Dialect,MsSql2005Dialect and MsSql2008Dialect #480)

My preferred option is 1.
/cc @oskarb?

@gliljas
Copy link
Member Author

gliljas commented Jan 10, 2017

Option 1 makes sense, since then there will only be an explicit way to use user type constants, and not also a brittle, implicit way.

Option 2 was what I wanted to do, but for an urgent fix, it seemed lika bad idea.

Option 3 is the best way, IMO, but also potentially tricky.

@hazzik
Copy link
Member

hazzik commented Jan 10, 2017

Found that MappedAs actually does not work...

@hazzik hazzik force-pushed the NH-3929 branch 2 times, most recently from 8ef4ab8 to 0f77b26 Compare January 10, 2017 01:42
* Users required to explicitly specify custom user type via MappedAs method if they want to use IUserType/ICompositeUserType type parameters in Linq queries with generators custom generators, or properly implement generators to take the type into account.
* Fix MappedAs method (NH-2401).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants