-->
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: How to define a default value for a property?
PostPosted: Sun Mar 13, 2005 5:55 pm 
Beginner
Beginner

Joined: Fri Jan 07, 2005 11:07 am
Posts: 30
Hi, I have a yes_no property and I want a record to have a
default value 'N' if a new record is inserted into a table and the program does
not assign a value for the property. How can I specify this need
in a class mapping file?

Thanks, Pete


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 13, 2005 7:04 pm 
Newbie

Joined: Sat Mar 12, 2005 12:01 pm
Posts: 8
I don't know if you can put it in the mapping file, but, why not just initialize it in your class?

example:


public class Foo {

private Long id;
private String yesNoProperty="N";

........


}


Top
 Profile  
 
 Post subject:
PostPosted: Sun Mar 13, 2005 7:30 pm 
Beginner
Beginner

Joined: Fri Jan 07, 2005 11:07 am
Posts: 30
Initializing it in a class is okay, but I feel a class mapping file may be
a better centralized place to have all information.

Cheers,
Pete


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.