This question is locked. New answers and comments are not allowed.
Hi Telerik Team!
I have a question about 'order by' clause.
I have two classes:
I try to sort results by property values
and receive an exception
Though prop.val in 'Where' clause works well
Could you please advice how I can order by collection values. Probably I need to change classes? I just need to have dynamic properties and ability to order by their values on SQL server side
Thanks in advance
Aliaksei
I have a question about 'order by' clause.
I have two classes:
/* NOTE: public class properties and methods omitted for clarity */ |
class Property{ |
string val; |
.. |
} |
class Product{ |
[ItemType(typeof(Property)] |
ArrayList properties; |
.. |
} |
I try to sort results by property values
select * from ProductExtent AS p, p.properties AS prop ORDER BY prop.val |
and receive an exception
Object reference not set to an instance of an object. |
at OpenAccessRuntime.Relational.sql.exp.SelectExp.handleOrderByFieldNavNode(FieldNavNode nav, SelectExp se, Node prevNode) |
at OpenAccessRuntime.Relational.sql.exp.SelectExp.addOrderBy(OrderNode[] orders, Boolean append, JDOQLNodeToSqlExp visitor) |
at OpenAccessRuntime.Relational.query.RelationalJDOQLCompiler.addOrderBy(SelectExp root) |
at OpenAccessRuntime.Relational.query.RelationalJDOQLCompiler.compileImp(ImmutableQueryDetails q) |
at OpenAccessRuntime.Relational.query.RelationalJDOQLCompiler.compile(ImmutableQueryDetails q) |
at OpenAccessRuntime.Relational.RelationalStorageManager.compile(ImmutableQueryDetails q) |
at OpenAccessRuntime.Relational.RelationalStorageManager.compileQuery(ImmutableQueryDetails query) |
at OpenAccessRuntime.storagemanager.logging.LoggingStorageManager.compileQuery(ImmutableQueryDetails query) |
Though prop.val in 'Where' clause works well
Could you please advice how I can order by collection values. Probably I need to change classes? I just need to have dynamic properties and ability to order by their values on SQL server side
Thanks in advance
Aliaksei