Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Adapting to existing database
Adapting to existing database [message #514344] Sun, 14 February 2010 19:39 Go to next message
Eclipse UserFriend
Originally posted by: ossipetz.gmail.com

Hello

I would like to get some advice. I am currently moving from hibernate to
eclipselink/JPA

My current task is to connect to an existing database that contains a
lot of logic. E.g. reading data is done by querying database views. So
an O/R mapping (what I am used to doing with hibernate) seems quite
straightforward.

The crucial point is the saving of data: this must be done calling
stored procedure (on the oracle database 10g / 11g).

I've seen there is an annotation @NamedStoredProcedureQuery in
eclipselink to use stored procedures.

Is it possible (or advisable) to mix reading (using standard O/R mapping
methods) and writing to the database with stored procedure calls?
Or must all operations be done via procedures?

How do relations behave with procedures?

There are quite a lot of tables and writing to table may change from
procedure to straight-forward inserts in the future.


I would be happy to hear some experience or get some advice on this.


Thanks a lot!


regards
ossi
Re: Adapting to existing database [message #517926 is a reply to message #514344] Tue, 02 March 2010 14:40 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

You can override any operation in EclipseLink using a stored procedure call. There are no JPA annotations for this yet, so you need to use a @DescriptorCustomizer and set the StoredProcedureCall into the DescriptorQueryManager. You can override any CRUD operation, as well as any mapping operation.

See,
http://wiki.eclipse.org/Configuring_a_Relational_Descriptor_ %28ELUG%29#How_to_Configure_Custom_SQL_Queries_for_Basic_Per sistence_Operations_Using_Java


James : Wiki : Book : Blog : Twitter
Previous Topic:Set JPA entities at runtime
Next Topic:EclipseLinkException
Goto Forum:
  


Current Time: Thu Nov 27 03:01:11 GMT 2014

Powered by FUDForum. Page generated in 0.05342 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software