Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

one EJB3 CMP mapped to different tables/schemes  RSS feed

Bernhard Neuhauser
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Is it possible to map one CMP to more then one Table/Schemes?

TestCMP => table "test"
but also
TestCMP => table "test_log"

Okay maybe its impossible to distinquish between the 2 purposes so maybe it can be solved by extending the TestCMP.

So TestLogCMP extends TestCMP mapped to some other table / scheme.

Whats neccesary to reach this goal?
Is it possible to do this with ejb3 annotations?

TestCMP might be the only productie Entity. The archive operation might be inside a databse trigger, so the db would copy the row to test_log. I just need the possiblility to work with the log entries casually, but it would be fine to avoid redundant code between both CMPs.

Any ideas?
Whats best practice in such a case?

Bernhard Neuhauser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!