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


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

Re: Using GROUP By or @OrderColumn in JPA

Path csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail
From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.java.programmer
Subject Re: Using GROUP By or @OrderColumn in JPA
Date Thu, 26 Nov 2015 08:25:13 -0500
Organization A noiseless patient Spider
Lines 38
Message-ID <n37137$94q$1@dont-email.me> (permalink)
References <87bnai8pu7.fsf@Equus.decebal.nl> <n35lmq$mph$1@speranza.aioe.org> <87two9e0l7.fsf@Equus.decebal.nl>
Mime-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Transfer-Encoding 8bit
Injection-Date Thu, 26 Nov 2015 13:22:47 -0000 (UTC)
Injection-Info mx02.eternal-september.org; posting-host="8b88f1819ae50b8afa97a5cef254b303"; logging-data="9370"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/WdufrupRQPJ26KFgo8uCi5M9NMQJg3vE="
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0
In-Reply-To <87two9e0l7.fsf@Equus.decebal.nl>
Cancel-Lock sha1:eTz17sAEnX5eGq9la2nnIYbC2dI=
Xref csiph.com comp.lang.java.programmer:33207

Show key headers only | View raw


On 11/26/2015 1:28 AM, Cecil Westerhof wrote:
> On Thursday 26 Nov 2015 02:02 CET, Arne Vajhøj wrote:
> 
>> On 11/25/2015 3:07 AM, Cecil Westerhof wrote:
>>> We are working on our first project with JPA. We had some bumps in
>>> the road, but I find it a good tool.
>>>
>>> We have an entity request which has a one to many relationship with
>>> estimate which has a one to one relationship with decision. One of
>>> the fields of decision is date.
>>>
>>> We need request-estimate-decision's where the date field of
>>> decision is not null and has the highest value. (We are only
>>> interested in the latest decision pro request.)
>>>
>>> I was thinking about a GROUP BY, but someone else thought about
>>> @OrderColumn. But if I understand it correctly an @OrderColumn
>>> needs an Integer and an index. We cannot change the database
>>> definition. So I suppose that @OrderColumn is not an option and we
>>> need to use the GROUP BY?
>>
>> How did you do it before with SQL?
> 
> This was never done with SQL. They made a JPQL query that was badly
> written. I managed to help rewrite it, so it is a bit clearer what is
> happening. But everything was done over instant message, which is not
> ideal. Today we will meet face to face and I hope to get a better
> understanding of what they want and have.
> 

Can you not use the ORDER BY clause in SQL?

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

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


Thread

Using GROUP By or @OrderColumn in JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-25 09:07 +0100
  Re: Using GROUP By or @OrderColumn in JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-25 20:02 -0500
    Re: Using GROUP By or @OrderColumn in JPA Cecil Westerhof <Cecil@decebal.nl> - 2015-11-26 07:28 +0100
      Re: Using GROUP By or @OrderColumn in JPA Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-26 08:25 -0500
      Re: Using GROUP By or @OrderColumn in JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-26 20:22 -0500
        Re: Using GROUP By or @OrderColumn in JPA Silvio <silvio@internet.com> - 2015-11-27 12:28 +0100
          Re: Using GROUP By or @OrderColumn in JPA Jerry Stuckle <jstucklex@attglobal.net> - 2015-11-27 09:22 -0500
            Re: Using GROUP By or @OrderColumn in JPA Silvio <silvio@internet.com> - 2015-11-27 17:42 +0100
              Re: Using GROUP By or @OrderColumn in JPA Silvio <silvio@internet.com> - 2015-11-27 17:43 +0100
                Re: Using GROUP By or @OrderColumn in JPA Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-27 18:21 +0000
          Re: Using GROUP By or @OrderColumn in JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-28 23:01 -0500
            Re: Using GROUP By or @OrderColumn in JPA Silvio <silvio@internet.com> - 2015-11-29 12:42 +0100
        Re: Using GROUP By or @OrderColumn in JPA Arne Vajhøj <arne@vajhoej.dk> - 2015-11-28 22:44 -0500
      Re: Using GROUP By or @OrderColumn in JPA Martin Gregorie <martin@address-in-sig.invalid> - 2015-11-27 11:07 +0000

csiph-web