home bbs files messages ]

Just a sample of the Echomail archive

COMPOSVM:

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

 Message 262,920 of 264,034 
 Lawrence D'Oliveiro to All 
 Re: VMS x86-64 database server 
 29 Jul 25 23:07:44 
 
From: ldo@nz.invalid

On Tue, 29 Jul 2025 09:39:51 -0400, Arne Vajhøj wrote:

> On 7/29/2025 12:25 AM, Lawrence D'Oliveiro wrote:
>>
>> On Mon, 28 Jul 2025 22:36:59 -0400, Arne Vajhøj wrote:
>>>
>>> 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.

So why does it have its own extra mechanism for formulating the query,
then? You yourself are admitting there is no benefit in that. Yet here you
are, having to go through that same extra layer of mechanism.

>> 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.

On the contrary, I use it a lot. Maybe the problem is that object models
make the idea hard to use.

> .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.

Can you explicitly call a “next()” method on an iterator object to
retrieve each record in turn?

--- 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