aspose file tools*
The moose likes Object Relational Mapping and the fly likes Populating JPA managed Entity from non-JPA managed entity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Populating JPA managed Entity from non-JPA managed entity" Watch "Populating JPA managed Entity from non-JPA managed entity" New topic
Author

Populating JPA managed Entity from non-JPA managed entity

Mat Michel
Greenhorn

Joined: Mar 03, 2011
Posts: 2
Hi

We have requirement where we have one Schema with all Tables are managed using JPA so has mapping between Tables and POJO is in place.

Now everyday some process runs brings new data in Non- JPA managed tables from those tables based on some ETL presently system loads
JPA managed tables.

Now we have requirement is to populate JPA managed POJO’s from Non_JPA managed tables using queries which used by ETL before and
Persist it to database via cache write back

Does anyone come across such situation where JPA managed database tables are populated by querying different non-JPA managed tables being in different schema?
What should be approach to handle such migration?

One approach I have is to use Native query feature of JPA to query data from Non-JPA based tables and perform population using return SqlResultSet.
When I checked JPA implementation of Hibernate it has very few details… so being concern about Native query approach.

Please provide you input on such requirement.

Matt
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Populating JPA managed Entity from non-JPA managed entity