This is a migrated thread and some comments may be shown as answers.

Does OA support custom columns?

1 Answer 51 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Dallas Sehlhorst
Top achievements
Rank 1
Dallas Sehlhorst asked on 01 Dec 2009, 04:31 PM
I would like to know if OpenAccess supports custom columns for data access.  I am asking this in reference to NHibernate's Formula property.  When you map a class property using Formula you can specify the exact SQL that needs to be generated to get the needed result.  Please see Ayende's blog post about it at : http://ayende.com/Blog/archive/2009/04/07/nhibernate-mapping-ltpropertygt.aspx  See point 5 for his explanation.  In his example he is using it to count to total number of Posts with the given Post Id without having to generate a separate query. 

I would like to do this to get the total number of rows to show in a grid for paging purposes.  Right now I am doing 2 seperate queries, but if I can put "count(*) over ()" in the query it will speed it up by removing the first Count query.

Another way NHibernate does this is by using a custom dialect using RegisterFunction.  Please see Ayende's blog at: http://ayende.com/Blog/archive/2007/04/27/Paged-data--Count-with-NHibernate-The-really-easy-way.aspx

Thanks for everyone's time!



1 Answer, 1 is accepted

Sort by
0
Jordan
Telerik team
answered on 04 Dec 2009, 04:27 PM
Hello Dallas Sehlhorst,

Unfortunately Open Access does not currently support expression / calculated / formula columns, so you will not be able to do optimization that you mention this way.
What you could do however, is create an optimized query as a stored procedure in the data base and then use this stored procedure with Open Access.

Sincerely yours,
Jordan
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Development (API, general questions)
Asked by
Dallas Sehlhorst
Top achievements
Rank 1
Answers by
Jordan
Telerik team
Share this question
or