1 Reply Latest reply on Nov 24, 2003 9:39 AM by randahl

    Custom type mapping

    randahl

      Just like JBoss maps instances of String and Boolean to database types in a proper way, I would like JBoss to map my own Xyz type to, say, a database String.

      String and Boolean are immutable classes and so is my Xyz class, so what I do not know is how to make JBoss capable of mapping back and forth between the database String and an instance of class Xyz. How can I do that?

      Any help would be highly appreciated.

      Randahl

        • 1. Re: Custom type mapping
          randahl

          I was thinking about adding a type mapping in the following way


          <java-type>com.company.Xyz</java-type>
          <jdbc-type>VARCHAR</jdbc-type>
          <sql-type>VARCHAR(16)</sql-type>

          </type-mapping>

          But I can't find anything in neither JBossCMP or or the JBossBook which states this is the way to go about it. Does anyone know if this works? Is there a better way?

          Anyone?

          Randahl