-->
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: Initializing a Boolean Variable in applicationContext.xml
PostPosted: Tue Jul 31, 2007 12:32 pm 
Newbie

Joined: Fri Jul 27, 2007 5:48 am
Posts: 8
Hey,

In my class, there is an uninitialized Boolean variable, and I want it to get initialized via applicationContext.xml. I know how to do for any basic variable or objects that are defined by me but not for objects like Strings, Boolean etc.

Can any one help me out?

Thanks,
Sucheta.


Top
 Profile  
 
 Post subject: Spring Question
PostPosted: Tue Jul 31, 2007 4:52 pm 
Newbie

Joined: Fri Apr 07, 2006 11:29 am
Posts: 17
This is a Spring question, not Hibernate; but to do that, you would just pass in the Spring representation of the boolean and Spring will take care of the mechanics.

So....

Code:
<bean id="blah" class="com.example.BlahClassImpl">
    <property name="boolVariable" value="true"/>
</bean>


Note that the proper bean structure for booleans is "isBoolVariable()" for the getter and "setBoolVariable(boolean inVariable)" for the setter.


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.