-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: versioned entities in Hibernate?
PostPosted: Sat Feb 28, 2009 9:50 am 
Newbie

Joined: Sat Feb 28, 2009 9:38 am
Posts: 4
Hi,

I am moving from Doctrine ORM in PHP to Hibernate. In Doctrine it supports a secondary table to keep entity versions, so I can keep a full history of all records of the entity. Well - thats PHP and Doctrine, I want to move my tables across to Hibernate and a JBoss backend.

Is there any way to do versioned objects in Hibernate?

Hope so - thanks, Philip

p.s.

http://www.doctrine-project.org/documen ... ersionable

CREATE TABLE blog_post_version (id BIGINT,
title VARCHAR(255),
body LONGTEXT,
version BIGINT,
PRIMARY KEY(id,
version)) ENGINE = INNODB
CREATE TABLE blog_post (id BIGINT AUTO_INCREMENT,
title VARCHAR(255),
body LONGTEXT,
version BIGINT,
PRIMARY KEY(id)) ENGINE = INNODB
ALTER TABLE blog_post_version ADD FOREIGN KEY (id) REFERENCES blog_post(id) ON UPDATE CASCADE ON DELETE CASCADE


Top
 Profile  
 
 Post subject: found it
PostPosted: Sun Mar 01, 2009 3:30 am 
Newbie

Joined: Sat Feb 28, 2009 9:38 am
Posts: 4
Hi,

I found what I was looking for:

http://www.infoq.com/news/2008/12/enver ... _hibernate
http://www.jboss.org/envers/

Thanks, Philip


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.