From: Michael T. (JIRA) <nh...@gm...> - 2011-05-25 17:25:50
|
Mapping by code does not quote column name for bag order -------------------------------------------------------- Key: NH-2742 URL: http://216.121.112.228/browse/NH-2742 Project: NHibernate Issue Type: Bug Components: Mapping by-code Affects Versions: 3.2.0Beta1 Reporter: Michael Teper Priority: Major Entity Operation has a bag with children of type OperationStep, that have an integer Order property that indicates their order. Mapping by code: // set up order or operation steps mapper.Class<Operation>(map => map.Bag(x => x.Steps, x => x.OrderBy(step => step.Order))); Query: var operations = (from op in session.Query<Operation>().Fetch(o => o.Steps) select op).ToArray(); SQL: select operation0_.Id as Id3_0_, steps1_.Id as Id0_1_, operation0_.DateCreated as DateCrea2_3_0_, operation0_.Creator as Creator3_0_, operation0_.Status as Status3_0_, steps1_.OperationId as Operatio3_0_1_, steps1_.[Order] as Order4_0_1_, steps1_.ExecutionCount as Executio5_0_1_, steps1_.DateOfNextExecution as DateOfNe6_0_1_, steps1_.DateOfLastExecution as DateOfLa7_0_1_, steps1_.TranslationSiloId as Translat8_0_1_, steps1_.BatchId as BatchId0_1_, steps1_.ExecutionInterval as Executi10_0_1_, steps1_.Type as Type0_1_, steps1_.OperationId as Operatio3_0__, steps1_.Id as Id0__ from [Operation] operation0_ left outer join OperationStep steps1_ on operation0_.Id = steps1_.OperationId order by Order Problem: The "Order" column in the SQL order by clause is not quoted, resulting in SQL error. -- 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 |