Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Union(How to create a union between an entity and another)
Union [message #642764] Thu, 02 December 2010 16:08 Go to next message
Manuele Piastra is currently offline Manuele PiastraFriend
Messages: 4
Registered: December 2010
Junior Member
Hello,

I have two entities:

Container
and
ContainerHistory

The second one has the same number and type of fields and contains all the instances of the first type that are archived after n days. In a Web Form I need to show a union of the Container Entities and the ContainerHistory. Is there a way to do this avoiding the use of a native query?

Thanks
Best Regards
Re: Union [message #642806 is a reply to message #642764] Thu, 02 December 2010 18:25 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

A native SQL query may be your best solution.

You could map a different class to both tables and query both and combine them.

You may also wish to investigate EclipseLink's history support.


James : Wiki : Book : Blog : Twitter
Re: Union [message #642889 is a reply to message #642806] Fri, 03 December 2010 08:37 Go to previous messageGo to next message
Manuele Piastra is currently offline Manuele PiastraFriend
Messages: 4
Registered: December 2010
Junior Member
Hi James,

thank you for the reply. Could you please give me the link to some documentation regarding EclipseLink's history support?

Thank you so much
Bye
Re: Union [message #643351 is a reply to message #642764] Mon, 06 December 2010 15:42 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

See,
http://wiki.eclipse.org/EclipseLink/Examples/JPA/History

and,
http://wiki.eclipse.org/Configuring_a_Descriptor_%28ELUG%29# Configuring_a_History_Policy



James : Wiki : Book : Blog : Twitter
Previous Topic:A tool for Converting JPA entities to XML/JAXB ?
Next Topic:Getting Double instead of BigDecimal when using EntityManager#createNativeQuery()
Goto Forum:
  


Current Time: Tue Apr 23 15:51:01 GMT 2024

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

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

Back to the top