Visual Paradigm Logo
     Build Quality Applications Faster, Better and Cheaper
 
Home | Products | Download | Documentation | Support | Resources | Partners | Quick Tour | Shop | Company |  
 
   Visual Paradigm Discussion Forum
  Login   [ Register ] Email: Password: Log me on automatically I lost my password  
Recent Topics
Advanced Search
How to select top in ORM?  
Forum Index -> Object Relational Mapping (ORM)
Author Message
ichbinvinh


Joined: 2007/06/02
Messages: 1

Offline

I hve tried to limit the returned results in ORM but unsuccessfully(= select top), I can only use Procedure to resolve this problem but this is not good because i must regenarate ORM layer each time i have a new Procedure. Can anyone give me a solution? thank you very much.
 
Jick


Joined: 2005/04/29
Messages: 2880

Offline

Hello ichbinvinh,

You may try using Criteria. Please call: criteria.setMaxResults()

Best regards,
Jick

Visual Paradigm International Ltd.
http://www.visual-paradigm.com

Build Quality Applications Faster, Better and Cheaper
 
Anonymous

hello Jick,
i use ORM.net of olero not nHibernate for ASP.NET 2.0. I must do that

Code:
DataManager dm = new DataManager(Config.Dsn);
         DataSet ds = dm.FillDataSet("SELECT TOP 5 * FROM Article ORDER BY Hits DESC", true); 
         // merge the data into DataManager 
         dm.PopulateObjectsFromDataSet(ds, "Article");
         ArticleCollection ac = dm.GetArticleCollectionFromDataSet().FilterByLangCode(BasePage.CurrentLanguage);
         DataList.DataSource = ac;
         DataList.DataBind();


thanks for reply me
 
Santm


Joined: 2008/02/18
Messages: 7

Offline

If ORM could generate hbm with 'formula' as property element in property tag it might not need criteria.setMaxResults()
 
 
   Forum Index -> Object Relational Mapping (ORM)
Go to:   
Powered by JForum 2.1.4 © 2005 - Rafael Steil