-->
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: inserting non property columns
PostPosted: Tue Mar 14, 2006 11:57 am 
Beginner
Beginner

Joined: Wed Sep 24, 2003 11:16 am
Posts: 20
Location: Turkey
Hi,
I have database model that have two columns common to every table:

ownerid, and updateSequenceNumber

since these columns can be populated by automatical means (for example; updateSeqnr is a number that is incremented for each row insert), and they are for sole infrastructural needs (not relevant to domain), I didn't include them in the domain objects. Also placing them into domain objects will bring unnecessary complexity.

under these circumstances, i am wondering how i can make hibernate include these fields with the generated insert query? their values could be obtained from elsewhere, this is the second part of the problem. what i'm really challenged is to make hibernate insert values into unmapped, non property columns.

thanks in advance,
regards

Hibernate version:3.1

Mapping documents: annotation based mapping

Name and version of the database you are using: oracle

_________________
may the source be with you!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 29, 2006 7:59 am 
Beginner
Beginner

Joined: Wed Sep 24, 2003 11:16 am
Posts: 20
Location: Turkey
I have poked with EntityPersister to create a customized entity persister that overrides EntityPersister.generateInsertString. But I think this is not the best way since it injects non property column values with sql string manipulation. Any other ideas please?

_________________
may the source be with you!


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.