To all:
I have a question about assigning the Java types in hbm.xml file. Usually you assign a Java type that is equivalent to the data type in the database.
For example, a DATE field would be assigned a java.sql.Timestamp. And numeric data fields would be assigned "java.lang.Integer". Is it ok for me to override the type and just assign java.lang.String to all the data types in the hbm.xml file? The reason why I would do this is because my businees requirement requires me to show a hyphen string, "-", for any null data on my web page. If I need to do any calculations, I would convert the String variables to a numeric in my business layer.
If I do override the datatype, do I go against any rules within hibernate?
Thank you for any help you can give me.
|