1 Reply Latest reply on Nov 5, 2003 7:32 AM by Randahl Fink Isaksen

    Persisting immutable objects

    Randahl Fink Isaksen Novice


      I would like to persist immutable objects as rows in my database tables without using BLOBs. As we all know, Strings are immutable, and JBoss stores them as varchars. URLs are immutable too, and I would like JBoss to store them as varchars containing the textual representation of the URL ("http://asdfasdf.com") instead of putting a BLOB in my URL column.

      Is this possible?

      My own idea is to have two properties on my EJB, one called "url" and one called "urlString". The "urlString" is a CMP field of type "String", and the "url" property is of type URL and simply takes care of converting from the String property to a real URL. Quite easy, but I would prefer if this could be handled by configuration like when you configure dependent value classes.