Re: Non-ORM layers over JDBC

From: Tore Halset <halset(at)pvv(dot)ntnu(dot)no>
To: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Non-ORM layers over JDBC
Date: 2008-03-26 10:21:45
Message-ID: EC039F3F-4D32-4863-A863-AE61106505DF@pvv.ntnu.no
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello.

On Mar 24, 2008, at 6:45 , Craig Ringer wrote:
> I'm fairly new to Java (sorry!) and struggling with the database
> access area.

A newbie should not question if he should use a ORM, but instead focus
on which ORM to use. Please spend some time finding a good ORM that
you feel comfortable with.

Why you should use an ORM:
* Less boring code to write when bringing over data from PostgreSQL
to your java application and back.
* Simpler refactoring. What if you want to change the primary key,
add a relationship or whatever.
* Easier to support several databases. Thanks to Apache Cayenne, my
app work with PostgreSQL, MS SQL Server and Derby and others.
* And lots of other good reasons you will discover.

When to not use an ORM:
* Some specially tuned reporting queries

> What do people here use? Just use the JDBC directly? Use an ORM
> layer even though you just target PostgreSQL and work around its
> limitations and quirks? Use a different ORM layer without weird
> limitations and quirks? Some other tool I haven't been able to find
> out about?

I am using Apache Cayenne. It is a simple and elegant ORM with a swing
modeler tool that helps you create the mapping.

http://cayenne.apache.org/

Regards,
- Tore.

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Woody Woodring 2008-03-26 12:53:32 Advice fetching Array data with JDBC 8.3 driver
Previous Message Joao Rui Leal 2008-03-26 10:19:38 Re: Deadlock while using getNotifications() and Statement.executeQuery()