• 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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic