You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Caroline Jen <ji...@yahoo.com> on 2007/06/07 16:51:23 UTC

Transfer Object in JSF, Spring, and Hibernate

The application on which I am working deploys the
JavaServer Faces, Spring and Hibernate frameworks.

We are going to use the "transfer object" to move data
between J2EE tiers from the front end to the back end
and vice versa.  In addition, data "types" may need to
be converted --

At the front end, the "type" of the data that are
entered by users may not match that in the database
table.  For example, checkboxes may be marked or left
blank by users.  The "type" of the checkboxes is
"boolean" in the JSF backing bean.  However, we have
either "Y" or "N" for the corresponding field in the
database table.

The JSF backing bean holds data as well as controller
functionality.  Of course, the transfer object holds
data only.

With regard to class properties, Is the transfer
object an exact copy of the JSF backing bean?  And at
which tier the data are converted to match their
correspoding "types" in the database tables?

We also have the "data objects" which are exact
representation of database tables.

Thanks for your advices.



 
____________________________________________________________________________________
Now that's room service!  Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097

Re: Transfer Object in JSF, Spring, and Hibernate

Posted by Gerald Müllan <bi...@gmail.com>.
Hi,

we are using a so called UserType to achieve a mapping between Java
objects and the SQL stuff. You are also using hibernate, so have a
look at the org.hibernate.usertype.UserType interface and it`s
implementations.

If you need an example mapping between boolean values and 'Y' or 'N',
mail me directly i can send you the corresponding class.

cheers,

Gerald

On 6/7/07, Caroline Jen <ji...@yahoo.com> wrote:
> The application on which I am working deploys the
> JavaServer Faces, Spring and Hibernate frameworks.
>
> We are going to use the "transfer object" to move data
> between J2EE tiers from the front end to the back end
> and vice versa.  In addition, data "types" may need to
> be converted --
>
> At the front end, the "type" of the data that are
> entered by users may not match that in the database
> table.  For example, checkboxes may be marked or left
> blank by users.  The "type" of the checkboxes is
> "boolean" in the JSF backing bean.  However, we have
> either "Y" or "N" for the corresponding field in the
> database table.
>
> The JSF backing bean holds data as well as controller
> functionality.  Of course, the transfer object holds
> data only.
>
> With regard to class properties, Is the transfer
> object an exact copy of the JSF backing bean?  And at
> which tier the data are converted to match their
> correspoding "types" in the database tables?
>
> We also have the "data objects" which are exact
> representation of database tables.
>
> Thanks for your advices.
>
>
>
>
> ____________________________________________________________________________________
> Now that's room service!  Choose from over 150,000 hotels
> in 45,000 destinations on Yahoo! Travel to find your fit.
> http://farechase.yahoo.com/promo-generic-14795097
>


-- 
http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces