From: Patrick E. (JIRA) <nh...@gm...> - 2010-10-31 16:49:40
|
Method for specifying IType of LINQ parameter --------------------------------------------- Key: NH-2401 URL: http://216.121.112.228/browse/NH-2401 Project: NHibernate Issue Type: Improvement Components: Linq Provider Affects Versions: 3.0.0.Beta1 Reporter: Patrick Earl -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Patrick E. (JIRA) <nh...@gm...> - 2010-10-31 20:03:58
|
[ http://216.121.112.228/browse/NH-2401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20094#action_20094 ] Patrick Earl commented on NH-2401: ---------------------------------- As mentioned by David Pfeffer in NH-2222, there's sometimes no way to derive the IType of a parameter being utilized in LINQ. He suggested an extension method such as [object].MappedAs([UserType]) to select the right type. > Method for specifying IType of LINQ parameter > --------------------------------------------- > > Key: NH-2401 > URL: http://216.121.112.228/browse/NH-2401 > Project: NHibernate > Issue Type: Improvement > Components: Linq Provider > Affects Versions: 3.0.0.Beta1 > Reporter: Patrick Earl > -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Omri F. (JIRA) <nh...@gm...> - 2011-02-05 16:09:13
|
[ http://216.121.112.228/browse/NH-2401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Omri Fima updated NH-2401: -------------------------- Attachment: nh_2401.patch a patch for NH-2401 as Thomas Hotz suggested, two extesion methods were written: session.Query<Person>.Where(x => x.SimpleProperty.SomeRelation( simpleValue)).MapParameter(simpleValue.GetType(), UserType) which allows to map any arbitrary System.Type to UserType. session.Query<Person>.Where(x => x.SimpleProperty.SomeRelation( simpleValue)).MapParameter(simpleValue, UserType) which provides a simpler form to map the parameter type from the parameter itself. but is less powerful, since it does not allow to map a base type, and allow the query to resolve the descendent parameter type. > Method for specifying IType of LINQ parameter > --------------------------------------------- > > Key: NH-2401 > URL: http://216.121.112.228/browse/NH-2401 > Project: NHibernate > Issue Type: Improvement > Components: Linq Provider > Affects Versions: 3.0.0.Beta1 > Reporter: Patrick Earl > Attachments: nh_2401.patch > > -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Patrick E. (JIRA) <nh...@gm...> - 2011-02-05 21:25:21
|
[ http://216.121.112.228/browse/NH-2401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=20547#action_20547 ] Patrick Earl commented on NH-2401: ---------------------------------- Hi Omri. Thanks for your work and thoughts on this issue. Both of the the methods suffer from the limitation that a single System.Type cannot be mapped to multiple ITypes. For example, a particular boolean value might be stored using YesNo for one column and Boolean for a different column. Since this parameter mapping would rarely be needed anyways, I'd much prefer it if it was specific to the parameter itself, as in other parameter apis (for example SetParameter(0, value, type)). For example: session.Query<Person>().Where(x => x.SimpleProperty.SomeRelation(simpleValue.MappedAs(UserType))) > Method for specifying IType of LINQ parameter > --------------------------------------------- > > Key: NH-2401 > URL: http://216.121.112.228/browse/NH-2401 > Project: NHibernate > Issue Type: Improvement > Components: Linq Provider > Affects Versions: 3.0.0.Beta1 > Reporter: Patrick Earl > Attachments: nh_2401.patch > > -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Omri F. (JIRA) <nh...@gm...> - 2011-05-28 07:27:35
|
[ http://216.121.112.228/browse/NH-2401?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Omri Fima updated NH-2401: -------------------------- Attachment: nh2401MappedAs.patch uploaded a patch for NH2401 using MappedAs extension method. it passed the NHibernate Tests so it shouldn't break anything, as well it makes the LINQ tests of Hibernate.Spatial pass, which heavily rely on the feature. > Method for specifying IType of LINQ parameter > --------------------------------------------- > > Key: NH-2401 > URL: http://216.121.112.228/browse/NH-2401 > Project: NHibernate > Issue Type: Improvement > Components: Linq Provider > Affects Versions: 3.0.0.Beta1 > Reporter: Patrick Earl > Attachments: nh2401MappedAs.patch, nh_2401.patch > > -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Omri F. (JIRA) <nh...@gm...> - 2011-07-03 11:33:03
|
[ http://216.121.112.228/browse/NH-2401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21341#action_21341 ] Omri Fima commented on NH-2401: ------------------------------- Is there anything else needed to be done, except for the patch, in order to close this issue?? > Method for specifying IType of LINQ parameter > --------------------------------------------- > > Key: NH-2401 > URL: http://216.121.112.228/browse/NH-2401 > Project: NHibernate > Issue Type: Improvement > Components: Linq Provider > Affects Versions: 3.0.0.Beta1 > Reporter: Patrick Earl > Attachments: nh2401MappedAs.patch, nh_2401.patch > > -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Patrick E. (JIRA) <nh...@gm...> - 2011-07-03 17:33:03
|
[ http://216.121.112.228/browse/NH-2401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21343#action_21343 ] Patrick Earl commented on NH-2401: ---------------------------------- There needs to be a unit test written. > Method for specifying IType of LINQ parameter > --------------------------------------------- > > Key: NH-2401 > URL: http://216.121.112.228/browse/NH-2401 > Project: NHibernate > Issue Type: Improvement > Components: Linq Provider > Affects Versions: 3.0.0.Beta1 > Reporter: Patrick Earl > Attachments: nh2401MappedAs.patch, nh_2401.patch > > -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: Patrick E. (JIRA) <nh...@gm...> - 2011-07-03 17:39:01
|
[ http://216.121.112.228/browse/NH-2401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=21344#action_21344 ] Patrick Earl commented on NH-2401: ---------------------------------- The unit test should at least demonstrate that a parameter that would normally be one type is converted to the new type that has been specified. This is already handled for simple equality, so it will have to be a more interesting case. > Method for specifying IType of LINQ parameter > --------------------------------------------- > > Key: NH-2401 > URL: http://216.121.112.228/browse/NH-2401 > Project: NHibernate > Issue Type: Improvement > Components: Linq Provider > Affects Versions: 3.0.0.Beta1 > Reporter: Patrick Earl > Attachments: nh2401MappedAs.patch, nh_2401.patch > > -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://216.121.112.228/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |