You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(110) |
Nov
(296) |
Dec
(107) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(212) |
Feb
(263) |
Mar
(161) |
Apr
(183) |
May
(183) |
Jun
(75) |
Jul
(106) |
Aug
(88) |
Sep
(227) |
Oct
(143) |
Nov
(154) |
Dec
(53) |
2008 |
Jan
(77) |
Feb
|
Mar
|
Apr
(6) |
May
(103) |
Jun
(296) |
Jul
(54) |
Aug
|
Sep
(379) |
Oct
(283) |
Nov
(224) |
Dec
(214) |
2009 |
Jan
(129) |
Feb
(257) |
Mar
(136) |
Apr
(12) |
May
(329) |
Jun
(434) |
Jul
(375) |
Aug
(171) |
Sep
|
Oct
|
Nov
|
Dec
(54) |
2010 |
Jan
(198) |
Feb
(76) |
Mar
(3) |
Apr
(1) |
May
|
Jun
(62) |
Jul
(210) |
Aug
(447) |
Sep
(330) |
Oct
(257) |
Nov
(133) |
Dec
(453) |
2011 |
Jan
(240) |
Feb
(128) |
Mar
(442) |
Apr
(320) |
May
(428) |
Jun
(141) |
Jul
(13) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: NHibernate J. <mik...@us...> - 2006-10-25 04:24:31
|
[ http://jira.nhibernate.org/browse/NH-773?page=all ] Sergey Koshcheyev closed NH-773: -------------------------------- Resolution: Not an Issue Closing, works as intended. > Nullable DateTime does not properly persist DateTime.MaxValue > ------------------------------------------------------------- > > Key: NH-773 > URL: http://jira.nhibernate.org/browse/NH-773 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.2.0.Beta1 > Reporter: Michael Teper > > public class DateTimeTest > { > int _id = 0; > DateTime? _dt = DateTime.MaxValue; > public int Id { get { return _id; } set { _id = value; } } > public DateTime? Dt { get { return _dt; } set { _dt = value; } } > } > <?xml version="1.0" encoding="utf-8" ?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="DateTimeTest" table="Test"> > <id name="Id" column="id" unsaved-value="0"> > <generator class="identity" /> > </id> > <property name="Dt" column="dt" /> > </class> > </hibernate-mapping> > If I save and then load the class, the Dt.Ticks value is 3155378975990000000, whereas DateTime.MaxValue.Ticks = 3155378975999999999. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-25 04:24:30
|
[ http://jira.nhibernate.org/browse/NH-772?page=all ] Sergey Koshcheyev updated NH-772: --------------------------------- Priority: Minor (was: Critical) Please submit more information: a test case (classes, mappings, code) would be great. Also submit the exception stack trace. > "System.NullReferenceException": When load entity class form table's column contained NULL value. > ------------------------------------------------------------------------------------------------- > > Key: NH-772 > URL: http://jira.nhibernate.org/browse/NH-772 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.2.0.Beta1 > Reporter: TREEBHOPH > Priority: Minor > > "System.NullReferenceException: Object reference not set to an instance of an object" > I get this ERROR when i try to load Entity Class from a table's column contained NULL value, the column's type is MySql Varchar; however if the colums has some value , the entity class can be loaded without ERROR! > The class that i load is a single class that no relationship to another class. > <?xml version="1.0" encoding="utf-8" ?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="DomainModelObject.GlobalUserAccount, DomainModelObject" table="glb_user_account" lazy="false"> > <id name="UserID" column="user_id" type="Int64"> > <generator class="identity" /> > </id> > <property name="LoginName" column="user_login_name" type="String" length="50" /> > <property name="Password" column="user_passwd" type="String" length="200" /> > <property name="Email" column="user_email" type="String" length="50" /> > <property name="RegistTime" column="user_create_time" type="DateTime" /> > </class> > </hibernate-mapping> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-25 04:22:36
|
[ http://jira.nhibernate.org/browse/NH-771?page=all ] Sergey Koshcheyev closed NH-771: -------------------------------- Resolution: Duplicate > "System.NullReferenceException": When load class form Table's Column contained NULL value. > ------------------------------------------------------------------------------------------ > > Key: NH-771 > URL: http://jira.nhibernate.org/browse/NH-771 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.2.0.Beta1 > Reporter: TREEBHOPH > Priority: Critical > > "System.NullReferenceException: Object reference not set to an instance of an object" > I get this ERROR when i try to load Entity Class from a table's column contained NULL value, the column's type is MySql Varchar; however if the colums has some value , the entity class can be loaded without ERROR! > The class that i load is a single class that no relationship to another class. > <?xml version="1.0" encoding="utf-8" ?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="DomainModelObject.GlobalUserAccount, DomainModelObject" table="glb_user_account" lazy="false"> > <id name="UserID" column="user_id" type="Int64"> > <generator class="identity" /> > </id> > <property name="LoginName" column="user_login_name" type="String" length="50" /> > <property name="Password" column="user_passwd" type="String" length="200" /> > <property name="Email" column="user_email" type="String" length="50" /> > <property name="RegistTime" column="user_create_time" type="DateTime" /> > </class> > </hibernate-mapping> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-25 04:22:33
|
[ http://jira.nhibernate.org/browse/NH-770?page=all ] Sergey Koshcheyev closed NH-770: -------------------------------- Resolution: Duplicate > "System.NullReferenceException": When load entity class form table's column contained NULL value. > ------------------------------------------------------------------------------------------------- > > Key: NH-770 > URL: http://jira.nhibernate.org/browse/NH-770 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.2.0.Beta1 > Reporter: TREEBHOPH > Priority: Trivial > > I use NHibernate 1.2.0 Beta1 with MySQL 5.0 > running on .NET FRAMEWORK 2.0, ASP.NET 2.0 > "System.NullReferenceException: Object reference not set to an instance of an object" > I get this ERROR when I try to load Entity Class from a table's column contains NULL value, column's type is Varchar; however if the colums has any value , the entity class can be loaded without ERROR! > The entity class that i loaded is a single class which no assiciation to anothor class. > So I think the ERROR is BUG. > <?xml version="1.0" encoding="utf-8" ?> > - <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > - <class name="DomainModelObject.GlobalUserAccount, DomainModelObject" table="glb_user_account" lazy="false"> > - <id name="UserID" column="user_id" type="Int64"> > <generator class="identity" /> > </id> > <property name="LoginName" column="user_login_name" type="String" length="50" /> > <property name="Password" column="user_passwd" type="String" length="200" /> > <property name="Email" column="user_email" type="String" length="50" /> > <property name="RegistTime" column="user_create_time" type="DateTime" /> > </class> > </hibernate-mapping> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 23:24:35
|
[ http://jira.nhibernate.org/browse/NH-741?page=comments#action_14179 ] Fabio Maulo commented on NH-741: -------------------------------- Comment for who have a problem for this issue: The patch not work if the RDBMS don't accept parameter for every thing else <where expression>. > Invalid parameter handling when using functions > ----------------------------------------------- > > Key: NH-741 > URL: http://jira.nhibernate.org/browse/NH-741 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.0.2 > Reporter: Bentzy Lupu > Priority: Trivial > Fix For: 1.2.0.Beta2 > > The following query fails because no parameter was defined. > select category from Category category > order by dbo.Localize(category.ResourceKey, :LanguageId, category.Name) > On SQL Server, the error is: > NHibernate.ADOException: Could not execute query > ---> System.IndexOutOfRangeException: Invalid index 0 for this SqlParameterCollection with Count=0. > at System.Data.SqlClient.SqlParameterCollection.RangeCheck(Int32 index) > at System.Data.SqlClient.SqlParameterCollection.GetParameter(Int32 index) > at System.Data.Common.DbParameterCollection.System.Collections.IList.get_Item(Int32 index) > at NHibernate.Type.Int32Type.Set(IDbCommand cmd, Object value, Int32 index) > at NHibernate.Type.NullableType.NullSafeSet(IDbCommand cmd, Object value, Int32 index) > at NHibernate.Type.NullableType.NullSafeSet(IDbCommand st, Object value, Int32 index, ISessionImplementor session) > at NHibernate.Hql.QueryTranslator.BindNamedParameters(IDbCommand ps, IDictionary namedParams, Int32 start, ISessionImplementor session) > at NHibernate.Loader.Loader.PrepareQueryCommand(SqlString sqlString, QueryParameters parameters, Boolean scroll, ISessionImplementor session) > at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies) > at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies) > at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet querySpaces, IType[] resultTypes) > at NHibernate.Hql.QueryTranslator.List(ISessionImplementor session, QueryParameters queryParameters) > at NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters) > --- End of inner exception stack trace --- > at NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters) > at NHibernate.Impl.QueryImpl.List() > at Lib.NHRepository.FindAll[T](String hql, KeyValuePair`2[] parameters) in D:\Proj\Test\Lib\NHRepository.cs:line 34 > This query, however, pass successfully: > select category from Category category where :LanguageId = :LanguageId > order by dbo.Localize(ResourceKey, @p0, Name) > The expected result should be either an error for not recognizing the function, or successfully handling this. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 22:20:35
|
[ http://jira.nhibernate.org/browse/NH-628?page=comments#action_14178 ] Fabio Maulo commented on NH-628: -------------------------------- Continue in SVN... > HQL functions mapping > --------------------- > > Key: NH-628 > URL: http://jira.nhibernate.org/browse/NH-628 > Project: NHibernate > Type: Improvement > Components: Data Providers > Versions: 1.2.0.Beta1 > Reporter: Fabio Maulo > Assignee: Fabio Maulo > Attachments: NH628CastFunction.patch, NH628First.patch, NH628Next1.patch, NH628Next2.patch > > For columns types we have RegisterColumnType in the dialect to registr the supported types for a specific dialect. > With RegisterColumnType we can map a DbType with a equivalent specific dialect type although it isn't directly supported (a DbType.Guid can be mapped to a CHAR(38)). > Functions haven't mapping so if i write "from Person p where lenght(p.Name) > 10" i can't sure that work with all, or many, dialect. If the "lenght" function is not supported by an specific dialect i don't recive a NHibernate excetion directly with the message "lenght is not supported by XYZ dialect". > I think that he would be useful to have a collection of "basic" HQL function that can be specialized for a specific > dialect. > For example NHb can have in it's HQLfunctionList: > -a function named "hblenstr" that recive a parameter type NHibernateUtil.String (or a property with type NHibernateUtil.String) and return a NHibernateUtil.Int32. > -a function named "hbNullToInt" that recive two parameter; the first is a NHibernateUtil.Int16 or NHibernateUtil.Int32 or NHibernateUtil.Int64 (or a property...); the 2th is a constant of type NHibernateUtil.Int16 .. etc. > Heach dialect can have an overload of RegisterFunction( string hbFunctionName, dialectFunctionName ). > For the two function in the example we can have: > for Oracle9Dialect > RegisterFunction("hblenstr","length"); > RegisterFunction("hbNullToInt","nvl"); > for MsSql2000Dialect > RegisterFunction("hblenstr","length"); > for FirebirdDialect (or a specific FirebirdDialect with extended UDFs ;) ) > RegisterFunction("hblenstr","strlen"); > RegisterFunction("hbNullToInt","invl"); > Now we can write an HQL like this "from Person p where hblenstr(p.Name) > 10" and NHb can substitue "hblenstr" with apropiate dialect function (before substitution can control that the hblenstr revive de apropiate param type etc.). > This posible implementation don't have problems if an hbXYZ function have the same name of specific dialect function (i think the probability is very low but there are no problems). > The actual implementation of RegisterFunction don't need any adjustment because all continue to work. > Finally: > -If a dialect use actual implementation of RegisterFunction and a developer use this function in a HQL he can't be sure that all work fine when he need to change de hibernate.cfg.xml to change the dialect. > -If a dialect was implemented with RegisterFunction( string hbFunctionName, dialectFunctionName ) mapping and a developer use the hbXYZ function in a HQL he can have an hight probability that all work fine. > Bye. > Fabio. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 20:13:39
|
[ http://jira.nhibernate.org/browse/NH-773?page=comments#action_14173 ] Fabio Maulo commented on NH-773: -------------------------------- SqlServer 2005 use a 64-bit for datetime. By default, for a DateTime property, NHb use the IType DateTimeType that only stores down to a second. You can force NHb to use an appropriate type using <property name="Dt" column="dt" type="Timestamp"/> Please let me know if it work for you. > Nullable DateTime does not properly persist DateTime.MaxValue > ------------------------------------------------------------- > > Key: NH-773 > URL: http://jira.nhibernate.org/browse/NH-773 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.2.0.Beta1 > Reporter: Michael Teper > > public class DateTimeTest > { > int _id = 0; > DateTime? _dt = DateTime.MaxValue; > public int Id { get { return _id; } set { _id = value; } } > public DateTime? Dt { get { return _dt; } set { _dt = value; } } > } > <?xml version="1.0" encoding="utf-8" ?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="DateTimeTest" table="Test"> > <id name="Id" column="id" unsaved-value="0"> > <generator class="identity" /> > </id> > <property name="Dt" column="dt" /> > </class> > </hibernate-mapping> > If I save and then load the class, the Dt.Ticks value is 3155378975990000000, whereas DateTime.MaxValue.Ticks = 3155378975999999999. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 19:41:37
|
[ http://jira.nhibernate.org/browse/NH-773?page=comments#action_14172 ] Fabio Maulo commented on NH-773: -------------------------------- Any way i think this is an external issue depending on the representation of DateTime in the specific RDBMS. Some RDBMS use a different representation for TIMESTAMP then NET2.0 (for example a 32-bit instead a 64-bit). Please verify wich is the representation of DateTime in your RDBMS. > Nullable DateTime does not properly persist DateTime.MaxValue > ------------------------------------------------------------- > > Key: NH-773 > URL: http://jira.nhibernate.org/browse/NH-773 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.2.0.Beta1 > Reporter: Michael Teper > > public class DateTimeTest > { > int _id = 0; > DateTime? _dt = DateTime.MaxValue; > public int Id { get { return _id; } set { _id = value; } } > public DateTime? Dt { get { return _dt; } set { _dt = value; } } > } > <?xml version="1.0" encoding="utf-8" ?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="DateTimeTest" table="Test"> > <id name="Id" column="id" unsaved-value="0"> > <generator class="identity" /> > </id> > <property name="Dt" column="dt" /> > </class> > </hibernate-mapping> > If I save and then load the class, the Dt.Ticks value is 3155378975990000000, whereas DateTime.MaxValue.Ticks = 3155378975999999999. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 19:36:34
|
[ http://jira.nhibernate.org/browse/NH-773?page=comments#action_14171 ] Michael Teper commented on NH-773: ---------------------------------- SqlServer 2005 > Nullable DateTime does not properly persist DateTime.MaxValue > ------------------------------------------------------------- > > Key: NH-773 > URL: http://jira.nhibernate.org/browse/NH-773 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.2.0.Beta1 > Reporter: Michael Teper > > public class DateTimeTest > { > int _id = 0; > DateTime? _dt = DateTime.MaxValue; > public int Id { get { return _id; } set { _id = value; } } > public DateTime? Dt { get { return _dt; } set { _dt = value; } } > } > <?xml version="1.0" encoding="utf-8" ?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="DateTimeTest" table="Test"> > <id name="Id" column="id" unsaved-value="0"> > <generator class="identity" /> > </id> > <property name="Dt" column="dt" /> > </class> > </hibernate-mapping> > If I save and then load the class, the Dt.Ticks value is 3155378975990000000, whereas DateTime.MaxValue.Ticks = 3155378975999999999. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 19:23:47
|
[ http://jira.nhibernate.org/browse/NH-773?page=comments#action_14170 ] Fabio Maulo commented on NH-773: -------------------------------- Which is the dialect you are using ? > Nullable DateTime does not properly persist DateTime.MaxValue > ------------------------------------------------------------- > > Key: NH-773 > URL: http://jira.nhibernate.org/browse/NH-773 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.2.0.Beta1 > Reporter: Michael Teper > > public class DateTimeTest > { > int _id = 0; > DateTime? _dt = DateTime.MaxValue; > public int Id { get { return _id; } set { _id = value; } } > public DateTime? Dt { get { return _dt; } set { _dt = value; } } > } > <?xml version="1.0" encoding="utf-8" ?> > <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> > <class name="DateTimeTest" table="Test"> > <id name="Id" column="id" unsaved-value="0"> > <generator class="identity" /> > </id> > <property name="Dt" column="dt" /> > </class> > </hibernate-mapping> > If I save and then load the class, the Dt.Ticks value is 3155378975990000000, whereas DateTime.MaxValue.Ticks = 3155378975999999999. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 18:30:37
|
Nullable DateTime does not properly persist DateTime.MaxValue ------------------------------------------------------------- Key: NH-773 URL: http://jira.nhibernate.org/browse/NH-773 Project: NHibernate Type: Bug Components: Core Versions: 1.2.0.Beta1 Reporter: Michael Teper public class DateTimeTest { int _id = 0; DateTime? _dt = DateTime.MaxValue; public int Id { get { return _id; } set { _id = value; } } public DateTime? Dt { get { return _dt; } set { _dt = value; } } } <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="DateTimeTest" table="Test"> <id name="Id" column="id" unsaved-value="0"> <generator class="identity" /> </id> <property name="Dt" column="dt" /> </class> </hibernate-mapping> If I save and then load the class, the Dt.Ticks value is 3155378975990000000, whereas DateTime.MaxValue.Ticks = 3155378975999999999. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 18:05:40
|
"System.NullReferenceException": When load entity class form table's column contained NULL value. ------------------------------------------------------------------------------------------------- Key: NH-772 URL: http://jira.nhibernate.org/browse/NH-772 Project: NHibernate Type: Bug Components: Core Versions: 1.2.0.Beta1 Reporter: TREEBHOPH Priority: Critical "System.NullReferenceException: Object reference not set to an instance of an object" I get this ERROR when i try to load Entity Class from a table's column contained NULL value, the column's type is MySql Varchar; however if the colums has some value , the entity class can be loaded without ERROR! The class that i load is a single class that no relationship to another class. <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="DomainModelObject.GlobalUserAccount, DomainModelObject" table="glb_user_account" lazy="false"> <id name="UserID" column="user_id" type="Int64"> <generator class="identity" /> </id> <property name="LoginName" column="user_login_name" type="String" length="50" /> <property name="Password" column="user_passwd" type="String" length="200" /> <property name="Email" column="user_email" type="String" length="50" /> <property name="RegistTime" column="user_create_time" type="DateTime" /> </class> </hibernate-mapping> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 18:03:37
|
"System.NullReferenceException": When load class form Table's Column contained NULL value. ------------------------------------------------------------------------------------------ Key: NH-771 URL: http://jira.nhibernate.org/browse/NH-771 Project: NHibernate Type: Bug Components: Core Versions: 1.2.0.Beta1 Reporter: TREEBHOPH Priority: Critical "System.NullReferenceException: Object reference not set to an instance of an object" I get this ERROR when i try to load Entity Class from a table's column contained NULL value, the column's type is MySql Varchar; however if the colums has some value , the entity class can be loaded without ERROR! The class that i load is a single class that no relationship to another class. <?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> <class name="DomainModelObject.GlobalUserAccount, DomainModelObject" table="glb_user_account" lazy="false"> <id name="UserID" column="user_id" type="Int64"> <generator class="identity" /> </id> <property name="LoginName" column="user_login_name" type="String" length="50" /> <property name="Password" column="user_passwd" type="String" length="200" /> <property name="Email" column="user_email" type="String" length="50" /> <property name="RegistTime" column="user_create_time" type="DateTime" /> </class> </hibernate-mapping> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 17:59:43
|
"System.NullReferenceException": When load entity class form table's column contained NULL value. ------------------------------------------------------------------------------------------------- Key: NH-770 URL: http://jira.nhibernate.org/browse/NH-770 Project: NHibernate Type: Bug Components: Core Versions: 1.2.0.Beta1 Reporter: TREEBHOPH Priority: Trivial I use NHibernate 1.2.0 Beta1 with MySQL 5.0 running on .NET FRAMEWORK 2.0, ASP.NET 2.0 "System.NullReferenceException: Object reference not set to an instance of an object" I get this ERROR when I try to load Entity Class from a table's column contains NULL value, column's type is Varchar; however if the colums has any value , the entity class can be loaded without ERROR! The entity class that i loaded is a single class which no assiciation to anothor class. So I think the ERROR is BUG. <?xml version="1.0" encoding="utf-8" ?> - <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0"> - <class name="DomainModelObject.GlobalUserAccount, DomainModelObject" table="glb_user_account" lazy="false"> - <id name="UserID" column="user_id" type="Int64"> <generator class="identity" /> </id> <property name="LoginName" column="user_login_name" type="String" length="50" /> <property name="Password" column="user_passwd" type="String" length="200" /> <property name="Email" column="user_email" type="String" length="50" /> <property name="RegistTime" column="user_create_time" type="DateTime" /> </class> </hibernate-mapping> -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 13:08:38
|
[ http://jira.nhibernate.org/browse/NH-423?page=comments#action_14169 ] Sergey Koshcheyev commented on NH-423: -------------------------------------- Can you attach a simple test case that would reproduce this? Note that this issue is resolved as "Cannot Reproduce", not "Fixed". > TransientObjectException when using an object from another session in a Query > ----------------------------------------------------------------------------- > > Key: NH-423 > URL: http://jira.nhibernate.org/browse/NH-423 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.0 > Reporter: Donald Mull > Attachments: Organization.hbm.xml > > When using an object from another session (loaded from the database) in a Query a TransientOBjectSession is thrown as if the object does not exist in the database. > Forum Thread: http://nhibernate.sourceforge.net/forum/viewtopic.php?t=1026 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 13:01:42
|
[ http://jira.nhibernate.org/browse/NH-423?page=comments#action_14168 ] Donald Mull commented on NH-423: -------------------------------- It's no so much working with 2 sessions at the same time but working with one session then another. I agree, however, there are more important tihngs to fix, this isn't a killer (it has a workaround, after all). I'm happy that it has been reproduced though so that it will one day be taken care of when someone has time (or it really bothers someone). :) > TransientObjectException when using an object from another session in a Query > ----------------------------------------------------------------------------- > > Key: NH-423 > URL: http://jira.nhibernate.org/browse/NH-423 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.0 > Reporter: Donald Mull > Attachments: Organization.hbm.xml > > When using an object from another session (loaded from the database) in a Query a TransientOBjectSession is thrown as if the object does not exist in the database. > Forum Thread: http://nhibernate.sourceforge.net/forum/viewtopic.php?t=1026 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 12:50:43
|
[ http://jira.nhibernate.org/browse/NH-423?page=comments#action_14167 ] John Chapman commented on NH-423: --------------------------------- This issue is not resolved. I have verified that it does exist in the nHibernate 1.0.2 codebase. I was able to work around this by using an HQL query and passing the value type primary keys of the object. I was previously using the Load method passing in the object with the existing keys when it threw an exception. The TransientObjectException only appeared after I added the version to the mapping file/class. Previously loading by Object worked fine. Note that in my case I am using a composite key of many-to-one types and that is why I was attempting to load using the object from the first session. The TransientObjectException was actually being thrown on one of the key object stating that it was transient and needed to be saved even though it was saved in the other session and already flushed by this point. The test looked something like the following: // Define the test object(s) ScheduleRun obj = Create(true, null); ScheduleRun savedObj = null; // Save the test object(s) Sessions[0].Flush(); // Start a new Session Sessions.New(); // Retrieve the test object(s) savedObj = (ScheduleRun)Sessions[1].Load(typeof(ScheduleRun), obj); Note that the Create method creates mock objects for this object and all many-to-one. The first parameter tells the create to using the Session.Save method on all created objects. The test fails (exception) on the last line where load is called. I would not call this a major bug since there is a relatively easy work around. Plus working with 2 sessions seems like a relatively rare occurance. > TransientObjectException when using an object from another session in a Query > ----------------------------------------------------------------------------- > > Key: NH-423 > URL: http://jira.nhibernate.org/browse/NH-423 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.0 > Reporter: Donald Mull > Attachments: Organization.hbm.xml > > When using an object from another session (loaded from the database) in a Query a TransientOBjectSession is thrown as if the object does not exist in the database. > Forum Thread: http://nhibernate.sourceforge.net/forum/viewtopic.php?t=1026 -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 11:04:38
|
[ http://jira.nhibernate.org/browse/NH-628?page=comments#action_14166 ] Fabio Maulo commented on NH-628: -------------------------------- Well... this is the matter.... - The HQLFunction is a port from H3.2. - Test are no present in H3.2. - For ClassicSum, ClassicAvg, ClassicCount i write the test using a sintax, for aggregate, that a user expect work like now in NHb but... with the H3.2 implementation it no work (the hinstory of this issue let me know that is better to have a real issue before to have a different implementation than H3). But.... the real problem with HQLFunction and NHb is another.... the parser... but this is another story. I'm working on the parser... > HQL functions mapping > --------------------- > > Key: NH-628 > URL: http://jira.nhibernate.org/browse/NH-628 > Project: NHibernate > Type: Improvement > Components: Data Providers > Versions: 1.2.0.Beta1 > Reporter: Fabio Maulo > Assignee: Fabio Maulo > Attachments: NH628CastFunction.patch, NH628First.patch, NH628Next1.patch, NH628Next2.patch > > For columns types we have RegisterColumnType in the dialect to registr the supported types for a specific dialect. > With RegisterColumnType we can map a DbType with a equivalent specific dialect type although it isn't directly supported (a DbType.Guid can be mapped to a CHAR(38)). > Functions haven't mapping so if i write "from Person p where lenght(p.Name) > 10" i can't sure that work with all, or many, dialect. If the "lenght" function is not supported by an specific dialect i don't recive a NHibernate excetion directly with the message "lenght is not supported by XYZ dialect". > I think that he would be useful to have a collection of "basic" HQL function that can be specialized for a specific > dialect. > For example NHb can have in it's HQLfunctionList: > -a function named "hblenstr" that recive a parameter type NHibernateUtil.String (or a property with type NHibernateUtil.String) and return a NHibernateUtil.Int32. > -a function named "hbNullToInt" that recive two parameter; the first is a NHibernateUtil.Int16 or NHibernateUtil.Int32 or NHibernateUtil.Int64 (or a property...); the 2th is a constant of type NHibernateUtil.Int16 .. etc. > Heach dialect can have an overload of RegisterFunction( string hbFunctionName, dialectFunctionName ). > For the two function in the example we can have: > for Oracle9Dialect > RegisterFunction("hblenstr","length"); > RegisterFunction("hbNullToInt","nvl"); > for MsSql2000Dialect > RegisterFunction("hblenstr","length"); > for FirebirdDialect (or a specific FirebirdDialect with extended UDFs ;) ) > RegisterFunction("hblenstr","strlen"); > RegisterFunction("hbNullToInt","invl"); > Now we can write an HQL like this "from Person p where hblenstr(p.Name) > 10" and NHb can substitue "hblenstr" with apropiate dialect function (before substitution can control that the hblenstr revive de apropiate param type etc.). > This posible implementation don't have problems if an hbXYZ function have the same name of specific dialect function (i think the probability is very low but there are no problems). > The actual implementation of RegisterFunction don't need any adjustment because all continue to work. > Finally: > -If a dialect use actual implementation of RegisterFunction and a developer use this function in a HQL he can't be sure that all work fine when he need to change de hibernate.cfg.xml to change the dialect. > -If a dialect was implemented with RegisterFunction( string hbFunctionName, dialectFunctionName ) mapping and a developer use the hbXYZ function in a HQL he can have an hight probability that all work fine. > Bye. > Fabio. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 09:00:35
|
Improve serialization of Session -------------------------------- Key: NH-769 URL: http://jira.nhibernate.org/browse/NH-769 Project: NHibernate Type: Improvement Components: Core Versions: 1.2.0.Beta2 Reporter: Peter Smulovics Priority: Minor Serialization of Session object is done using the default methods, resulting in time and space consuming binary objects. Technologies like FastSerializer ( http://www.codeproject.com/dotnet/FastSerializer.asp ) may help a lot. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 08:02:34
|
[ http://jira.nhibernate.org/browse/NH-628?page=comments#action_14165 ] Sergey Koshcheyev commented on NH-628: -------------------------------------- Yes, I just don't know whether Fabio intended this test to fail or not. > HQL functions mapping > --------------------- > > Key: NH-628 > URL: http://jira.nhibernate.org/browse/NH-628 > Project: NHibernate > Type: Improvement > Components: Data Providers > Versions: 1.2.0.Beta1 > Reporter: Fabio Maulo > Assignee: Fabio Maulo > Attachments: NH628CastFunction.patch, NH628First.patch, NH628Next1.patch, NH628Next2.patch > > For columns types we have RegisterColumnType in the dialect to registr the supported types for a specific dialect. > With RegisterColumnType we can map a DbType with a equivalent specific dialect type although it isn't directly supported (a DbType.Guid can be mapped to a CHAR(38)). > Functions haven't mapping so if i write "from Person p where lenght(p.Name) > 10" i can't sure that work with all, or many, dialect. If the "lenght" function is not supported by an specific dialect i don't recive a NHibernate excetion directly with the message "lenght is not supported by XYZ dialect". > I think that he would be useful to have a collection of "basic" HQL function that can be specialized for a specific > dialect. > For example NHb can have in it's HQLfunctionList: > -a function named "hblenstr" that recive a parameter type NHibernateUtil.String (or a property with type NHibernateUtil.String) and return a NHibernateUtil.Int32. > -a function named "hbNullToInt" that recive two parameter; the first is a NHibernateUtil.Int16 or NHibernateUtil.Int32 or NHibernateUtil.Int64 (or a property...); the 2th is a constant of type NHibernateUtil.Int16 .. etc. > Heach dialect can have an overload of RegisterFunction( string hbFunctionName, dialectFunctionName ). > For the two function in the example we can have: > for Oracle9Dialect > RegisterFunction("hblenstr","length"); > RegisterFunction("hbNullToInt","nvl"); > for MsSql2000Dialect > RegisterFunction("hblenstr","length"); > for FirebirdDialect (or a specific FirebirdDialect with extended UDFs ;) ) > RegisterFunction("hblenstr","strlen"); > RegisterFunction("hbNullToInt","invl"); > Now we can write an HQL like this "from Person p where hblenstr(p.Name) > 10" and NHb can substitue "hblenstr" with apropiate dialect function (before substitution can control that the hblenstr revive de apropiate param type etc.). > This posible implementation don't have problems if an hbXYZ function have the same name of specific dialect function (i think the probability is very low but there are no problems). > The actual implementation of RegisterFunction don't need any adjustment because all continue to work. > Finally: > -If a dialect use actual implementation of RegisterFunction and a developer use this function in a HQL he can't be sure that all work fine when he need to change de hibernate.cfg.xml to change the dialect. > -If a dialect was implemented with RegisterFunction( string hbFunctionName, dialectFunctionName ) mapping and a developer use the hbXYZ function in a HQL he can have an hight probability that all work fine. > Bye. > Fabio. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 07:51:01
|
[ http://jira.nhibernate.org/browse/NH-628?page=comments#action_14164 ] Ayende Rahien commented on NH-628: ---------------------------------- The result seems like it fails to understand the meaning of distinct in the query. (not a different parameter). I would say tha tthis is not good. > HQL functions mapping > --------------------- > > Key: NH-628 > URL: http://jira.nhibernate.org/browse/NH-628 > Project: NHibernate > Type: Improvement > Components: Data Providers > Versions: 1.2.0.Beta1 > Reporter: Fabio Maulo > Assignee: Fabio Maulo > Attachments: NH628CastFunction.patch, NH628First.patch, NH628Next1.patch, NH628Next2.patch > > For columns types we have RegisterColumnType in the dialect to registr the supported types for a specific dialect. > With RegisterColumnType we can map a DbType with a equivalent specific dialect type although it isn't directly supported (a DbType.Guid can be mapped to a CHAR(38)). > Functions haven't mapping so if i write "from Person p where lenght(p.Name) > 10" i can't sure that work with all, or many, dialect. If the "lenght" function is not supported by an specific dialect i don't recive a NHibernate excetion directly with the message "lenght is not supported by XYZ dialect". > I think that he would be useful to have a collection of "basic" HQL function that can be specialized for a specific > dialect. > For example NHb can have in it's HQLfunctionList: > -a function named "hblenstr" that recive a parameter type NHibernateUtil.String (or a property with type NHibernateUtil.String) and return a NHibernateUtil.Int32. > -a function named "hbNullToInt" that recive two parameter; the first is a NHibernateUtil.Int16 or NHibernateUtil.Int32 or NHibernateUtil.Int64 (or a property...); the 2th is a constant of type NHibernateUtil.Int16 .. etc. > Heach dialect can have an overload of RegisterFunction( string hbFunctionName, dialectFunctionName ). > For the two function in the example we can have: > for Oracle9Dialect > RegisterFunction("hblenstr","length"); > RegisterFunction("hbNullToInt","nvl"); > for MsSql2000Dialect > RegisterFunction("hblenstr","length"); > for FirebirdDialect (or a specific FirebirdDialect with extended UDFs ;) ) > RegisterFunction("hblenstr","strlen"); > RegisterFunction("hbNullToInt","invl"); > Now we can write an HQL like this "from Person p where hblenstr(p.Name) > 10" and NHb can substitue "hblenstr" with apropiate dialect function (before substitution can control that the hblenstr revive de apropiate param type etc.). > This posible implementation don't have problems if an hbXYZ function have the same name of specific dialect function (i think the probability is very low but there are no problems). > The actual implementation of RegisterFunction don't need any adjustment because all continue to work. > Finally: > -If a dialect use actual implementation of RegisterFunction and a developer use this function in a HQL he can't be sure that all work fine when he need to change de hibernate.cfg.xml to change the dialect. > -If a dialect was implemented with RegisterFunction( string hbFunctionName, dialectFunctionName ) mapping and a developer use the hbXYZ function in a HQL he can have an hight probability that all work fine. > Bye. > Fabio. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 07:04:33
|
[ http://jira.nhibernate.org/browse/NH-763?page=comments#action_14163 ] Sergey Koshcheyev commented on NH-763: -------------------------------------- Also, I don't think that looking into every resource to find out whether it contains "<hibernate-mapping" is a good thing to do... Looks too much like a hack to me so I'd suggest you only keep this in your application. > NHibernate Does Not Recognize Dependent Resources > ------------------------------------------------- > > Key: NH-763 > URL: http://jira.nhibernate.org/browse/NH-763 > Project: NHibernate > Type: Improvement > Components: Core > Versions: 1.2.0.Beta1 > Reporter: Chris Moore > Priority: Minor > Attachments: HbmResFinder.txt > > SUMMARY: NHibernate will not recognize mapping resource files that are dependent upon their associated domain classes. > DETAIL: Visual Studio/MSBuild uses a "dependency" scheme that can associate a resource file with a given class. This mechanism is used, for instance, to bind RESX files with their associated forms. Among other things, this allows the environment to display the dependent resource files as child nodes of the associated form classes. For example, to associate the hibernate resource "Person.hbm.xml" resource with the file "Person.cs" one would configure the MBBuild file thusly: > <Compile Include="Person.cs"/> > <EmbeddedResource Include="Person.hbm.xml"> > <DependentUpon>Person.cs</DependentUpon> > </EmbeddedResource> > In addition to cleaning up the tree in the project view, this approach also has the advantage of declaratively advertising the extant association between a map file and a domain class. > Now, here is the core of the problem: The compiler will embed the mapping resource with the name of the type with which it is associated "Person" instead of the full name of the file "Person.hbm.xml". In this case, NHibernate will not be able to find the "Person" resource is not found and the assembly registration process will fail because NHibernate currently discriminates mapping resources via the file extension "hbm.xml". > SOLUTION: The assumption that the resource will include the "hbm.xml" extension is made in two places: near line 627 in NHibernate.Cfg.Configuration and near line 55 in NHibernate.Cfg.AssemblyHbmOrderer. Replacing this logic to discriminate, instead, on the content of the file (e.g. determine with a given resource is an xml file with xmlns="urn:nhibernate-mapping-2.0"). > OTHER BENEFITS: Removing the requirment that mapping resource files must be named with the "hbm.xml" extension opens up Visual Studio integration possibilities. One could for example, integrate a custom tool that is designed to edit files of type "*.hbm". > REMARKS: If this fix is accepted, I would be willing to provide the code that would perform this content-based discrimination. Most likely, I would write a "MapResourceFinder" utility class that would do this work. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 07:02:36
|
[ http://jira.nhibernate.org/browse/NH-763?page=all ] Sergey Koshcheyev updated NH-763: --------------------------------- Version: 1.2.0.Beta1 Priority: Minor (was: Major) type: Improvement (was: Bug) I don't view this as a bug since the problem isn't in NHibernate and you can always just use AddResource if AddAssembly doesn't work correctly for you. > NHibernate Does Not Recognize Dependent Resources > ------------------------------------------------- > > Key: NH-763 > URL: http://jira.nhibernate.org/browse/NH-763 > Project: NHibernate > Type: Improvement > Components: Core > Versions: 1.2.0.Beta1 > Reporter: Chris Moore > Priority: Minor > Attachments: HbmResFinder.txt > > SUMMARY: NHibernate will not recognize mapping resource files that are dependent upon their associated domain classes. > DETAIL: Visual Studio/MSBuild uses a "dependency" scheme that can associate a resource file with a given class. This mechanism is used, for instance, to bind RESX files with their associated forms. Among other things, this allows the environment to display the dependent resource files as child nodes of the associated form classes. For example, to associate the hibernate resource "Person.hbm.xml" resource with the file "Person.cs" one would configure the MBBuild file thusly: > <Compile Include="Person.cs"/> > <EmbeddedResource Include="Person.hbm.xml"> > <DependentUpon>Person.cs</DependentUpon> > </EmbeddedResource> > In addition to cleaning up the tree in the project view, this approach also has the advantage of declaratively advertising the extant association between a map file and a domain class. > Now, here is the core of the problem: The compiler will embed the mapping resource with the name of the type with which it is associated "Person" instead of the full name of the file "Person.hbm.xml". In this case, NHibernate will not be able to find the "Person" resource is not found and the assembly registration process will fail because NHibernate currently discriminates mapping resources via the file extension "hbm.xml". > SOLUTION: The assumption that the resource will include the "hbm.xml" extension is made in two places: near line 627 in NHibernate.Cfg.Configuration and near line 55 in NHibernate.Cfg.AssemblyHbmOrderer. Replacing this logic to discriminate, instead, on the content of the file (e.g. determine with a given resource is an xml file with xmlns="urn:nhibernate-mapping-2.0"). > OTHER BENEFITS: Removing the requirment that mapping resource files must be named with the "hbm.xml" extension opens up Visual Studio integration possibilities. One could for example, integrate a custom tool that is designed to edit files of type "*.hbm". > REMARKS: If this fix is accepted, I would be willing to provide the code that would perform this content-based discrimination. Most likely, I would write a "MapResourceFinder" utility class that would do this work. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 06:54:38
|
[ http://jira.nhibernate.org/browse/NH-628?page=comments#action_14161 ] Sergey Koshcheyev commented on NH-628: -------------------------------------- After applying the last patch three tests fail for me in SimpleFunctionsTest: ClassicSum, ClassicAvg, ClassicCount. Is this expected? The failure messages are like this: NUnit.Framework.AssertionException: String lengths differ. Expected length=17, but was length=18. Strings differ at index 12. expected: <"avg(distinct va1)"> but was: <"avg(distinct, va2)"> ------------------------^ at NUnit.Framework.Assert.AreEqual(Object expected, Object actual) at NHibernate.Test.HQLFunctionTest.SimpleFunctionsTest.ClassicAvg() in SimpleFunctionsTest.cs:line 214 > HQL functions mapping > --------------------- > > Key: NH-628 > URL: http://jira.nhibernate.org/browse/NH-628 > Project: NHibernate > Type: Improvement > Components: Data Providers > Versions: 1.2.0.Beta1 > Reporter: Fabio Maulo > Assignee: Fabio Maulo > Attachments: NH628CastFunction.patch, NH628First.patch, NH628Next1.patch, NH628Next2.patch > > For columns types we have RegisterColumnType in the dialect to registr the supported types for a specific dialect. > With RegisterColumnType we can map a DbType with a equivalent specific dialect type although it isn't directly supported (a DbType.Guid can be mapped to a CHAR(38)). > Functions haven't mapping so if i write "from Person p where lenght(p.Name) > 10" i can't sure that work with all, or many, dialect. If the "lenght" function is not supported by an specific dialect i don't recive a NHibernate excetion directly with the message "lenght is not supported by XYZ dialect". > I think that he would be useful to have a collection of "basic" HQL function that can be specialized for a specific > dialect. > For example NHb can have in it's HQLfunctionList: > -a function named "hblenstr" that recive a parameter type NHibernateUtil.String (or a property with type NHibernateUtil.String) and return a NHibernateUtil.Int32. > -a function named "hbNullToInt" that recive two parameter; the first is a NHibernateUtil.Int16 or NHibernateUtil.Int32 or NHibernateUtil.Int64 (or a property...); the 2th is a constant of type NHibernateUtil.Int16 .. etc. > Heach dialect can have an overload of RegisterFunction( string hbFunctionName, dialectFunctionName ). > For the two function in the example we can have: > for Oracle9Dialect > RegisterFunction("hblenstr","length"); > RegisterFunction("hbNullToInt","nvl"); > for MsSql2000Dialect > RegisterFunction("hblenstr","length"); > for FirebirdDialect (or a specific FirebirdDialect with extended UDFs ;) ) > RegisterFunction("hblenstr","strlen"); > RegisterFunction("hbNullToInt","invl"); > Now we can write an HQL like this "from Person p where hblenstr(p.Name) > 10" and NHb can substitue "hblenstr" with apropiate dialect function (before substitution can control that the hblenstr revive de apropiate param type etc.). > This posible implementation don't have problems if an hbXYZ function have the same name of specific dialect function (i think the probability is very low but there are no problems). > The actual implementation of RegisterFunction don't need any adjustment because all continue to work. > Finally: > -If a dialect use actual implementation of RegisterFunction and a developer use this function in a HQL he can't be sure that all work fine when he need to change de hibernate.cfg.xml to change the dialect. > -If a dialect was implemented with RegisterFunction( string hbFunctionName, dialectFunctionName ) mapping and a developer use the hbXYZ function in a HQL he can have an hight probability that all work fine. > Bye. > Fabio. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |
From: NHibernate J. <mik...@us...> - 2006-10-24 05:04:37
|
[ http://jira.nhibernate.org/browse/NH-768?page=all ] Sergey Koshcheyev closed NH-768: -------------------------------- Fix Version: 1.2.0.Beta2 Resolution: Fixed > Delete fails when using optimistic-lock and bags > ------------------------------------------------ > > Key: NH-768 > URL: http://jira.nhibernate.org/browse/NH-768 > Project: NHibernate > Type: Bug > Components: Core > Versions: 1.2.0.Beta1 > Reporter: Lukas Macedo > Priority: Trivial > Fix For: 1.2.0.Beta2 > > It adds an extra AND without any element or value where the bag is. > For example: > <class name="TABLE" table="TABLENAME"> > <id name="RowId" type="Guid" column="RowId" optimistic-lock="dirty" dynamic-update="true" dynamic-insert="true"> > <generator class="guid" /> > </id> > <bag name="LocationQuantitySummaryList" lazy="true" inverse="true" cascade="none"> > <key column="R_LOCATION"/> > <one-to-many class="LocationQuantitySummary"/> > </bag> > <property name="UserDefinedCode6" column="UserDefinedCode_6"/> > </class> > If you try to delete this entity, it will end up with the following statement: > DELETE FROM TABLENAME WHERE ROWID = 'XXX' AND AND USERDEFINEDCODE_6 = "TEST" > Thanks, > Lukas -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.nhibernate.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira |