• Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple persistence units with different column mappings

 
Sebastian Meyer
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As the topic implies I want to save one object into two different persistence units. These units/databases have different table layouts therefor I want to somehow define different column-mappings for each of the persistence units (like Customer.name goes into Column "name" in table A and "cust_name" in table B).

Any clues how to solve this either with native JPA oder proprietary Hibernate annotations/xml? Thanks in advance...
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Hibernate you can specify which mapping files to use when you create a Configuration. So, theoretically you could create multiple Configurations and handle the problem that way, but there's probably a simpler solution...
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!