-->
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.  [ 5 posts ] 
Author Message
 Post subject: Object Value and Hibernate classes : the same ?
PostPosted: Sun Mar 07, 2004 6:14 am 
Beginner
Beginner

Joined: Mon Sep 15, 2003 9:10 am
Posts: 43
i have in my application differents layers :

- application
- dao
- service
- ui (mvc : struts)

In my action, i call a factory of services which return a service implementation of users : UsersService. Then i call UsersService.getUser(login, password), it is return me a User class.

User is (for me) :
- an object value
- User is a class generated by hibernate from an hbm.xml.

Is it a good way ?

Can i use the classes generate by hibernate for objects values VO in my service ?

Thanks,

Fabien.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 08, 2004 6:22 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
yes

_________________
Emmanuel


Top
 Profile  
 
 Post subject: That's great !
PostPosted: Mon Mar 08, 2004 6:49 am 
Beginner
Beginner

Joined: Mon Sep 15, 2003 9:10 am
Posts: 43
Thanks


Top
 Profile  
 
 Post subject: Always or better way ?
PostPosted: Mon Mar 08, 2004 10:03 am 
Beginner
Beginner

Joined: Mon Sep 15, 2003 9:10 am
Posts: 43
Is it always a good or better way to do this :
---------------------------------------------------

A generate file from mapping like this :

class _User {

.....

}


A entreprise object like :

class VOUser extends _User{

.....

fields and methods than doesn't need to persist in database

}


Top
 Profile  
 
 Post subject: Re: Always or better way ?
PostPosted: Mon Mar 08, 2004 10:50 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Is it always a good way, you need to map "VOUser" for this.
Sometimes this way is better:

class VOUser extends UIObject{

_User getUser()
.....

fields and methods than doesn't need to persist in database

}

or

class VOUser extends UIObject{

void paint(_User user);
.....

fields and methods than doesn't need to persist in database


}


fmourioux wrote:
Is it always a good or better way to do this :
---------------------------------------------------

A generate file from mapping like this :

class _User {

.....

}


A entreprise object like :

class VOUser extends _User{

.....

fields and methods than doesn't need to persist in database

}


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.