• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DataModel changes and HistoryPolicies

 
Carlos Conti
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

after some struggling I have finally set up HistoryPolicies enabling record of history in my data model. However in order to fullfill our requirements I need to store somewhere what has been modified and who has attained such changes. If I could store the timestamp of the modification, the id and the class of the modified object, and the active user id in a single row, I believe it would be enough for our data requirements regarding data tracking.

Another approach would be to create a many-to-one relationship from every modifiable entity to a user (which would be the active user in every action), but I don't think thats the best solution.

Can anybody point me on the right path to make that? Perhaps I am struggling with something which can be attained in a much simpler way.
Thanks in advance for your help.
Carlos.
 
Carlos Conti
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your quick response...
I will try to implement it by writting the audit values in a separate table where I store the class name, id value, timestamp and activeuser when a JPA Event is triggered
That should mostly solve it.

Thanks for your advise, it was very helpful...

However I must see now how can I find the analogue solution with the tools I am using. I don't use annotations, but an orm.xml file (which from my late experience I believe it was a wrong decison->Most documentation is developed with Annotations! :argh

MySQL 6.0
JPA Provder EclipseLink 1.1
ApacheTomcat 6.0
JSF 1.2 (IceFaces)

Thanks again!
Carlos.
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The JPA ORM XML is basically a 1-1 match of the annotations. Each annotation is generally an element with the same name as lower case with "-" between words.

i.e.
@OneToOne -> <one-to-one>

All of the XML schemas are listed here,
http://wiki.eclipse.org/EclipseLink/XSDs
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic