-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Struts + Hibernate question
PostPosted: Mon Sep 27, 2004 12:56 am 
Newbie

Joined: Thu Sep 16, 2004 1:10 pm
Posts: 5
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


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 6:55 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Use a UserType


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 11:59 am 
Newbie

Joined: Thu Sep 16, 2004 1:10 pm
Posts: 5
Hi, Michael

What's a UserType ?

regards
James


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 27, 2004 3:44 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Please, search the website and/or the Forum for it


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.