Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #33089

Re: Performance JPA

From Arne Vajhøj <arne@vajhoej.dk>
Newsgroups comp.lang.java.programmer
Subject Re: Performance JPA
Date 2015-11-10 21:35 -0500
Organization Aioe.org NNTP Server
Message-ID <n1u9hk$rei$1@speranza.aioe.org> (permalink)
References (3 earlier) <56389a9e$0$23778$e4fe514c@news.xs4all.nl> <n1bnte$2j8$2@speranza.aioe.org> <5639ce9d$0$23755$e4fe514c@news.xs4all.nl> <n1meib$8bh$2@speranza.aioe.org> <564065be$0$23861$e4fe514c@news.xs4all.nl>

Show all headers | View raw


On 11/9/2015 4:22 AM, Silvio wrote:
> On 11/08/2015 04:12 AM, Arne Vajhøj wrote:
>> On 11/4/2015 4:23 AM, Silvio wrote:
>>> On 11/04/2015 02:44 AM, Arne Vajhøj wrote:
>>>> em.createQuery is easy and generate an equivalent SQL to the one
>>>> to chose if manually written.
>>>
>>> Sure, that is why I said it could be fixed by changing the code. But
>>> IMHO it is a bit of a wart on the whole idea of having entities
>>> represented as individual instances (which I generally consider a stupid
>>> idea in the first place).
>>
>> ????
>>
>> Having a method that returns a collection of objects is basic
>> feature in almost all data access code.

> No, it is not. Only if you are used to doing things to ORM (or ODBMS, if
> that still exists) way.

Not true.

It is also common for non-ORM based data access code.

A few random examples:

* Spring JDBC - its JdbcTemplate.quert returns a list of object
* EAP/Fowler - Row Data Gateway and Data Mapper
* Core J2EE patterns - DAO
* Balus C's DAO demo at 
http://balusc.omnifaces.org/2008/07/dao-tutorial-data-layer.html

BTW, it should not really be necessary to argue this. Exposed API's
should be independent of implementation. That is very basic OO. And
one consequence of that is that the data access API should not depend on
whether the implementation use ORM or not.

>                         Having an object that represents a set of
> database entities is not the same as having a set of objects that
> represent individual database entities.
>
> Database actions like SELECT, UPDATE or DELETE are by definition
> operations on sets, not on individual entities. The former makes that
> trivial to represent, that latter makes it very hard. Once you have a
> collection of objects representing individual entities you have to write
> explicit code to do set operations.

Not true.

A single em.createQuery(sql).getResultList() return data for SELECT and
a single em.createQuery(sql).executeUpdate(0 does the updates for the rest.

> But you have demonstrated many times to have a one track mind when it
> concerns ORMs so I am sure you will disagree.

I am not really arguing about what I can agree with or disagree
with.

I am arguing about what is facts.

Arne

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-02 09:47 +0100
  Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-02 14:23 +0100
    Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-03 07:52 +0100
      Re: Performance JPA Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-03 11:16 +0000
        Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-03 19:11 +0100
          Re: Performance JPA Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-03 19:15 +0000
            Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-04 09:28 +0100
              Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-10 08:07 +0100
                Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-10 10:35 +0100
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-11 06:20 +0100
                Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-11 09:32 -0500
                Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-10 19:56 -0500
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-11 06:50 +0100
                Re: Performance JPA Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-11 12:17 +0000
                Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-11 09:30 -0500
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-11 23:20 +0100
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-11 23:11 +0100
                Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-11 19:10 -0500
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-12 07:27 +0100
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-13 08:30 +0100
                Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-13 10:45 +0100
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-13 11:06 +0100
                Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-13 13:36 +0100
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-20 09:04 +0100
                Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-13 21:46 -0500
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-20 09:09 +0100
          Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-03 20:35 -0500
            Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-04 09:35 +0100
              Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-07 22:09 -0500
      Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-03 12:29 +0100
        Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-03 19:23 +0100
        Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-03 20:44 -0500
          Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-04 09:48 +0100
          Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-04 10:23 +0100
            Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-04 11:27 +0100
              Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-04 12:42 +0100
                Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-07 22:18 -0500
                Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-09 10:43 +0100
                Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-20 09:13 +0100
            Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-07 22:12 -0500
              Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-09 10:22 +0100
                Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-10 21:35 -0500
                Re: Performance JPA Silvio <silvio@internet.com> - 2015-11-11 11:29 +0100
      Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-03 20:42 -0500
        Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-04 11:19 +0100
          Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-07 22:05 -0500
  Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-02 20:08 -0500
    Re: Performance JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-03 07:55 +0100
      Re: Performance JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-03 20:45 -0500
  Re: Performance JPA Lew <lewbloch@gmail.com> - 2015-11-16 14:43 -0800

csiph-web