openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Toffetti <>
Subject Re: JPA 3.0
Date Mon, 28 Jun 2010 21:53:01 GMT

Daryl Stultz-2 wrote:
> On Fri, Jun 25, 2010 at 8:46 PM, Daniel Toffetti
> <>wrote:
>>    Some time ago I started a quest for a magic tool,
>>    Thanks in advance for any useful tool or URL I might have missed.
> I don't know exactly what you are looking for, but if you haven't looked
> at it, try Ebean. It's pretty flexible with mixing "ORM queries" with
> raw/native SQL.
> -- 
> Daryl Stultz

    I stumbled on this site a couple of times, it seemed too similar to JPA
then, but now I've taken a closer look at the docs and it seems to have some
good points in favor.
    First, it supports all the JPA annotations so using it is somewhat close
to standards. Second, it implements a different entity lifecycle (but still
within the limits of the JPA spec), so I can have detached entities.
    So perhaps I'm very close to my ideal tool.
    I appreciate very much your help, thanks !!!

Russell Collins wrote:
> I have never tried to use JPA with Stored Procedures so excuse my
> ignorance.  If it is difficult or not available, it would benefit the spec
> if JPA would easily use stored procedures and views just like it uses
> tables.  The only thing I think would need to be added to a marked-up
> Entity Object is something like a stored procedure input annotation. 
> Example:
> @Column(name = "admid", nullable=false, length=10)
> @Id
> @ProcedureInput(procedurename = "sp1" name = "somename1", length =  10)
> @ProcedureInput(procedurename = "sp2" name = "somename2", length =  10)
> private String id;
> Just a suggestion.  Hopefully it can spark some good discussion.

    EclipseLink has some non-standard annotations to help in calling stored

    They are non-standard but perhaps, being already supported by
EclipseLink, they are considered in a future JPA release.
    The main problem with this is that using stored procedures contradicts
the nature of ORM. An SP can modify some live or cached entities,
invalidating them.
    Now EBean (the library suggested by Daryl), being somewhat different in
regards to native operations in the database, offers some support for
hinting what entities might have changed externally (see ebeans 
user guide, section 9.5), so the tool takes care of cached entities

    In the end, I believe there are two different philosophies and
attempting to make use of both at the same time can become increasingly

Thanks for your help,


View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message