Skip to main content



      Home
Home » Eclipse Projects » EclipseLink » Union(How to create a union between an entity and another)
Union [message #642764] Thu, 02 December 2010 11:08 Go to next message
Eclipse UserFriend
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 13:25 Go to previous messageGo to next message
Eclipse UserFriend
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.
Re: Union [message #642889 is a reply to message #642806] Fri, 03 December 2010 03:37 Go to previous messageGo to next message
Eclipse UserFriend
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 10:42 Go to previous message
Eclipse UserFriend
See,
http://wiki.eclipse.org/EclipseLink/Examples/JPA/History

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

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: Fri Jul 04 09:56:40 EDT 2025

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

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

Back to the top