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: Map property that's doesn't exists in database
PostPosted: Fri Apr 04, 2008 12:33 pm 
Beginner
Beginner

Joined: Mon Jan 14, 2008 10:58 am
Posts: 24
Hi,
I have a menu class with some standard properties like name, id.
But now I added a stored procedure that collects menuitems with one increased column, IsExpanded (Boolean).
This column doesn't exist in the database table, it's created in the procedure.
The property just marks the menuitem if a user has clicked on it or not.

How do I map this property?
If I map it with a ordinary property I just get: Invalid column name.
Do I have to add this "temporary" column to the database table and just leave it blank?


Top
 Profile  
 
 Post subject:
PostPosted: Sat Apr 05, 2008 10:54 am 
Newbie

Joined: Tue Apr 01, 2008 8:55 am
Posts: 4
I have never had to do this myself, but I think you do this by specifying

insert="false" update="false"

in your mapping document.

check out the following blog. About halfway down in the "Comment Mapping" section, the author discusses this briefly. Do a find on "That's because this value/column doesn't actually exist in the database" and it will take you to the section.

good luck.

blog url: http://devlicio.us/blogs/alan_northam/archive/2007/05/23/getting-started-with-nhibernate-part-iii.aspx


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.