next up previous contents
Next: In-lining Up: Storing in the Database Previous: Referential constraints   Contents


Some objects like users, are referenced all over the database, and when a user is removed from the system it is important not to delete them. Instead we must keep the user (in order for those things that reference him to still be valid), and end-date them. This is done by adding a time-stamp to an end-date column which represents the time at which the user was removed from the system.

To do this you simply add an attribute to the class element.

<class name="org.ephman.examples.user.generated.User"
      identity="oid" end-date="true">

The end-date="true" will specify to have an end-date column - and the extended factory now becomes EndDateFactoryBase which extends FactoryBase and has extra code which delimits searches for end-date=null, and when delete is called the object is end-dated(not removed).