Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » metamodel with two data sources using annotations(Metamodel with annotations getting data from multiple sources.)
metamodel with two data sources using annotations [message #1022914] Fri, 22 March 2013 15:31 Go to next message
Michele Cozart is currently offline Michele Cozart
Messages: 1
Registered: March 2013
Junior Member
I'm using Eclipselink 2.4 and I'm trying to create a metamodel class using annotations that references data being returned from a view and also from various stored procedures. I've looked at some promising ones (MappedSuperclass, multitenant ...) but I'm not sure of the best way to proceed.

The view and queries are both read-only and their data structure is the same. I don't want to have to duplicate code by creating a model for each. Any suggestions would be appreciated. Thanks.
Re: metamodel with two data sources using annotations [message #1027059 is a reply to message #1022914] Tue, 26 March 2013 10:09 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

You should be able to map an Entity to the view. For the stored procedures you should be able to use a @NamedStoredProcedureQuery that maps to the same entity class.


James : Wiki : Book : Blog : Twitter
Previous Topic:Infinite loop with self-referencing bi-directional relationship
Next Topic:validate unique column before commit
Goto Forum:
  


Current Time: Mon Jul 28 06:35:49 EDT 2014

Powered by FUDForum. Page generated in 0.02958 seconds