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: mapping a non-property
PostPosted: Mon Nov 19, 2007 3:00 pm 
Newbie

Joined: Tue May 08, 2007 12:21 pm
Posts: 4
I'm wondering if there is a way, using hibernate mapping (annotations preferred) to map a database field that is not persisted and not a property within the associated POJO. For my particular example it is the password field. I want it created by hibernates hbm2ddl feature but I want the business object to have absolutely no knowledge of the field. Additionally, I need to know if a field defined in this matter can be queried against using HQL.

Any help is much appreciated.

Thanks
Brian


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 20, 2007 9:51 am 
Beginner
Beginner

Joined: Thu Nov 02, 2006 9:38 am
Posts: 32
Location: Belgium
I think it's possible to supply your own mechanism for getting/setting your entity properties. Two of the built-in ways are: using getter/setter pairs on the class, and using java reflection. I think you can define your own property accessor in the mapping file. Then write a property accessor that does nothing at all, effectively ignoring your field!


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.