At 9:13 PM +0000 2/16/04, Raymond Barlow wrote:
Hi all,

I've got a field in a class that I would like to persist. The field datatype is BookingStatus. BookingStatus is defined as follows:

public class BookingStatus
{

   private BookingStatus(){};
     public static final BookingStatus NEW       = new BookingStatus();
   public static final BookingStatus CONFIRMED = new BookingStatus();
   public static final BookingStatus CANCELLED = new BookingStatus();
   public static final BookingStatus COMPLETE  = new BookingStatus();
  }

How do I setup the repostory_user.xml to use this datatype? Is this possible or must I stick to 'primitive typed instance variables'?

I've always handled this by giving the statuses limited properties and mapping them explicitly. Unfortunately when you do this you lose the ability to do true equality checks against your constants. Then again, I've usually needed the ability to display some human readable label along with them, and display them in an ordered list, etc. so the tradeoff for me was obvious; I just put them in a very small database table and populated the properties for "id", "label," and "order"


Ultimately, though, if OJB is going to persist them, or even references to them, it's going to need something it can decompose -- objects with no properties are going to knock it for a loop.

Joe

--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "Imagine if every Thursday your shoes exploded if you tied them the usual way. This happens to us all the time with computers, and nobody thinks of complaining."
-- Jef Raskin


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to