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.  [ 1 post ] 
Author Message
 Post subject: Question : Mapping default values to columns not in Classes
PostPosted: Wed Apr 11, 2007 3:25 pm 
Newbie

Joined: Wed Apr 11, 2007 3:18 pm
Posts: 1
Product = NHibernate
Version = 1.2

I have several fields in my database tables typically the following:

CreateBy
CreateDateUTC
UpdateBy
UpdateDateUTC

The classes don't have these fields or information because they don't need to know about them They are for auditing.

Is there an easy way to do this in the mapping. Something like

<column name="UpdateBy" sql-type="varchar(50)" default="CurrentIdentity.Id"/>

<column name="UpdateDateDTC" sql-type="datetime" default="GetUTCDATE()"/>

I know this is a stretech but I don't like adding triggers to the dbase to do the same thing.


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

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.