home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.os.vms      DEC's VAX* line of computers & VMS.      264,096 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 262,917 of 264,096   
   =?UTF-8?Q?Arne_Vajh=C3=B8j?= to Lawrence D'Oliveiro   
   Re: VMS x86-64 database server   
   29 Jul 25 09:39:51   
   
   From: arne@vajhoej.dk   
      
   On 7/29/2025 12:25 AM, Lawrence D'Oliveiro wrote:   
   > On Mon, 28 Jul 2025 22:36:59 -0400, Arne Vajhøj wrote:   
   >> Even with ORM you need to express the query.   
   >   
   > So a lot of the stuff in SQLAlchemy is useless, then?   
      
   No.   
      
   It does what it is supposed to do: do the mapping between   
   the query result and the object model.   
      
   >> JPQL example (ORM specific query language):   
   >>   
   >> List res = em.createQuery("SELECT o FROM T1 AS o WHERE o.f > 0",   
   >> T1.class).getResultList();   
   >   
   > That seems like a really dumb idea. You see my point about having   
   > their own query language does nothing to simplify the code.   
      
   Again: the benefit is not in the query but in the fact that it   
   stuff the query result into the object model without any   
   application code.   
      
   >> The big difference in the above two examples compared to traditional   
   >> SQL API (JDBC and ADO.NET for Java and .NET) is that it return a   
   >> List instead of a generic result like List.   
   >   
   > Is there a version that returns an iterator? Can be more   
   > memory-efficient for dealing with lots of returned records.   
      
   Usually there are.   
      
   But it is a rare requirement when using object models.   
      
   .NET has one of the easiest ways to do it.   
      
   List res = db.T1.Where(o => o.F > 0).ToList();   
   foreach(T1 o in res)   
      
   will materialize all rows in memory and then iterate over   
   it, but:   
      
   foreach(T1 o in db.T1.Where(o => o.F > 0))   
      
   will iterate directly.   
      
   (for JPA you either need to move up to Spring JPA or   
   move down to Hibernate to iterate)   
      
   Arne   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca