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.  [ 3 posts ] 
Author Message
 Post subject: Reuseable components
PostPosted: Fri Jul 27, 2007 11:20 am 
Newbie

Joined: Tue Jul 24, 2007 4:58 pm
Posts: 6
For logging purposes, several tables of my database contain the same four fields:

SysCreatedOn
SysCreatedBy
SysLastUpdatedOn
SysLastUpdatedBy

I have an AuditLog class that contains properties for each of the above values. I also have an IAuditable interface that defines AuditLog as a property.

I'm using an NHibernate Interceptor to populate the values of my AuditLog property (for any business object implementing IAuditable).

I'm finding it cumbersome to have to include the component element & property mappings for each of my business objects implementing IAuditable.

What I would really love is a way to define the component once (in its own mapping file) and somehow reference it in any of the mappings which I know will use it. That way, if I ever decide to add a 5th property I wouldn't have to updated dozens of mapping files, just the one AuditLog class and the one mapping of the component.

Or better still, create a mapping file containing the component with the class name set to IAuditable (no table name) and every time a Business Object implements IAuditable, the mapping file is automatically used.

Is there some way, maybe with some fancy reflection, to setup something like this?

-Mike.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 27, 2007 2:02 pm 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
This is something I was looking for a while back too. Maybe you should create a JIRA issue for it?

Cheers,

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 27, 2007 4:05 pm 
Regular
Regular

Joined: Fri Jan 27, 2006 2:32 pm
Posts: 102
Location: California, USA
+1

I have the same four fields and would like to see this...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.