This content has been marked as final.
Show 2 replies
-
1. Re: How to change the default table names and column names f
adamw Jun 6, 2008 4:32 AM (in response to richardhan)Hello,
as for configuring Envers with Hibernate, it is enough to add the listeners to hibernate.cfg.xml:<session-factory> <event type="post-insert"> <listener class="org.jboss.envers.event.VersionsEventListener" /> </event> <event type="post-update"> <listener class="org.jboss.envers.event.VersionsEventListener" /> </event> <event type="post-delete"> <listener class="org.jboss.envers.event.VersionsEventListener" /> </event> </session-factory>
As for the type of the revision number, currently is hard-coded to be int/Integer, but you're right that it should be changed (http://jira.jboss.org/jira/browse/ENVERS-12).
If you have an entity annotated with @RevisionEntity, you change the table name and field names in the normal way, as with any other entity (so with @Table, @Column annotations). Is that what you asked about, or didn't I understand? :)
ps The newest dev (http://www.jboss.org/envers/downloads/development) version of the library has a changed db schema, so it'd be better if you used this. This schema won't change until the 1.0 release.
--
Adam -
2. Re: How to change the default table names and column names f
adamw Jun 9, 2008 7:13 AM (in response to richardhan)Hello,
the revision number can now be a long (the type of the field annotated with @RevisionNumber should be a long/Long). Also, all methods that previously accepted int revision, now accept Number revision, so you can pass either an int or a long.
--
Adam