Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #26065
| Path | csiph.com!eeepc.pasdenom.info!news.pasdenom.info!news.dougwise.org!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!weretis.net!feeder4.news.weretis.net!news.albasani.net!not-for-mail |
|---|---|
| From | Lew <noone@lewscanon.com> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: The easiest framework for Java Database applications development released for production use |
| Date | Mon, 07 Feb 2011 21:33:14 -0500 |
| Organization | albasani.net |
| Lines | 53 |
| Message-ID | <iiqa0q$q4v$1@news.albasani.net> (permalink) |
| References | <740c95bd-a21f-4ad3-8733-6b3b61e44e18@l18g2000yqm.googlegroups.com> <MPG.27b8fec562e57f9e9897c8@news.justthe.net> <iinp9v$765$1@news.albasani.net> <92e64642-b624-4598-beaa-c57540a30733@k22g2000yqh.googlegroups.com> <iioobf$h14$1@news.albasani.net> <55029b5a-726d-4e31-96b7-3de2adbe7f5d@d19g2000yql.googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=UTF-8; format=flowed |
| Content-Transfer-Encoding | 8bit |
| X-Trace | news.albasani.net Sm6Y5ak/dWR4bsZ8l77ncFIVWekiwb857V1+pafVFMVy86Etu7B/R00h4FfeMDFcalF/uPuk36yzz0ekt9naYw== |
| NNTP-Posting-Date | Tue, 8 Feb 2011 02:32:59 +0000 (UTC) |
| In-Reply-To | <55029b5a-726d-4e31-96b7-3de2adbe7f5d@d19g2000yql.googlegroups.com> |
| Cancel-Lock | sha1:7zBB/gsQ5PzEyiGg8kXcGaC67XM= |
| User-Agent | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 |
| Injection-Info | news.albasani.net; logging-data="fVJ/QVaHh9DJACxjgj6x6gRAb5rmzV/xf20AtCVzRhkGBcbgDZR4tuux2WpvqjsiSw66povTbopaai4bqSoAW5RUqf00BdNldeZd4Faj64I0dW7m87OKuEgw2ImjjHDl"; mail-complaints-to="abuse@albasani.net" |
| Xref | csiph.com comp.lang.java.programmer:26065 |
Show key headers only | View raw
yaormaAdmin wrote:
> What would the code you would write to get the data from the
> message_table and echo it to the console in the example at www.yaorma.org
> look like?
You assume I would write code like that. I wouldn't, normally. In a toy
example where everything fits in one 'main()' call, there's not much you can
conclude about the utility of a framework.
The question isn't whether you can simplify a single call to a database for a
single hard-coded query. The question is whether you can build a robust,
stable, extendible application backed by a database. Knocking away a couple
of 'close()' calls is of minor value in such a context.
But to answer your question for the toy example, something similar to
public class Foo
{
@PersistenceContext( unitName = "pcontext" )
private EntityManager em;
public List <Message> findMessages()
{
final CriteriaQuery <Message> cq =
em.getCriteriaBuilder().createQuery( Message.class );
cq.select( cq.from( Message.class ));
return em.createQuery( cq ).getResultList();
}
public static void main( String [] args )
{
System.out.println( new Foo().findMessages() );
}
}
Or I might use a JQL query instead of the 'CriteriaQuery'. It's just that the
criteria approach is amenable to generic treatment - my actual code has a type
parameter for the 'Message' type.
--
Lew
Ceci n'est pas une fenêtre.
.___________.
|###] | [###|
|##/ | *\##|
|#/ * | \#|
|#----|----#|
|| | * ||
|o * | o|
|_____|_____|
|===========|
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Re: The easiest framework for Java Database applications development released for production use Lew <noone@lewscanon.com> - 2011-02-06 22:35 -0500
Re: The easiest framework for Java Database applications development released for production use Lew <lew@lewscanon.com> - 2011-02-07 09:57 -0800
Re: The easiest framework for Java Database applications development released for production use yaormaAdmin <yaorma@gmail.com> - 2011-02-07 11:19 -0800
Re: The easiest framework for Java Database applications development released for production use Lew <lew@lewscanon.com> - 2011-02-07 08:10 -0800
Re: The easiest framework for Java Database applications development released for production use yaormaAdmin <yaorma@gmail.com> - 2011-02-07 09:32 -0800
Re: The easiest framework for Java Database applications development released for production use Arne Vajhøj <arne@vajhoej.dk> - 2011-02-08 19:08 -0500
Re: The easiest framework for Java Database applications development released for production use Arne Vajhøj <arne@vajhoej.dk> - 2011-02-07 18:04 -0500
Re: The easiest framework for Java Database applications development released for production use yaormaAdmin <yaorma@gmail.com> - 2011-02-07 18:59 -0800
Re: The easiest framework for Java Database applications development released for production use yaormaAdmin <yaorma@gmail.com> - 2011-02-07 19:18 -0800
Re: The easiest framework for Java Database applications development released for production use Lew <noone@lewscanon.com> - 2011-02-09 07:55 -0500
Re: The easiest framework for Java Database applications development released for production use yaormaAdmin <yaorma@gmail.com> - 2011-02-06 20:30 -0800
Re: The easiest framework for Java Database applications development released for production use yaormaAdmin <yaorma@gmail.com> - 2011-02-08 05:44 -0800
Re: The easiest framework for Java Database applications development released for production use Steve Sobol <sjsobol@JustThe.net> - 2011-02-06 21:54 -0800
Re: The easiest framework for Java Database applications development released for production use Arne Vajhøj <arne@vajhoej.dk> - 2011-02-07 18:00 -0500
Re: The easiest framework for Java Database applications development released for production use Lew <noone@lewscanon.com> - 2011-02-07 21:33 -0500
Re: The easiest framework for Java Database applications development released for production use Arne Vajhøj <arne@vajhoej.dk> - 2011-02-08 19:06 -0500
Re: The easiest framework for Java Database applications development released for production use Wojtek <nowhere@a.com> - 2011-02-08 21:59 -0800
Re: The easiest framework for Java Database applications development released for production use Lew <noone@lewscanon.com> - 2011-02-07 07:25 -0500
csiph-web