Hi,
I exploring a combination of using struts with hibernate as a application solution. As I have previously designed, I would usually used String variables in a struts form object to represent a POJO. However in the case of hibernate, when a POJO is mapped against the database, here comes the question of having another POJO that represent a row in the database. Simple ! as I would have thought, combine them into one.
However, this is not the case, when you start having columns that are date specific. That would mean that the POJO that represents the database row would have a date variables. Since we have the POJO(struts form object) to be displayed on the webpage, that would mean we need convert the POJO(hibernate)'s date into POJO(Struts form object) String. Wouldn't that be a duplication of code just because of a date variable ?
Is there anything in Hibernate, such as custom String class, that automatically do this conversion, Database Column (Date) ===> POJO(hibernate mapping)String ?
Any advice/design/knowledge is appreciated. Thanks in advance.
regards
|