-->
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: DAO Implimentation
PostPosted: Thu Jan 05, 2006 5:06 am 
Beginner
Beginner

Joined: Mon Dec 26, 2005 4:55 pm
Posts: 28
I am currently reading some documentation regarding the dara access object related with Hibernate. I found a very good example over here:

http://www.hibernate.org/328.html

However, I also downloaded the CA example, and when I went to compare the two implementations, I found out that they are different. At a closer look I believe that the CA implementation is simpler to understand, so I followed that one (altough they are very the same).

However which one of these two is the correct version?

regards,
sim085

ps: I am mostly talking on GenericHibernateDAO.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 5:28 am 
Beginner
Beginner

Joined: Mon Dec 26, 2005 4:55 pm
Posts: 28
I also have some questions on what the two following methods do:

[code]
public T makePersistent(T entity)
public void makeTransient(T entity)
[/code]

I can understand that makePersistent is saving the state of the object within the database. makeTransient calls a delete method. Does that mean that the object looses it's connection with the database? I can not figure out why this method is to be used.

regards,
sim085


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 5:39 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
Quote:
Does that mean that the object looses it's connection with the database?


prefer the object is no longer persistant, it is not stored anymore into the database.

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 5:47 am 
Beginner
Beginner

Joined: Mon Dec 26, 2005 4:55 pm
Posts: 28
Thanks anthony :)

regards,
sim085


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 05, 2006 7:08 am 
Beginner
Beginner

Joined: Mon Dec 26, 2005 4:55 pm
Posts: 28
And why are the methods

[code]
setPersistantClass()
getPersistantClass()
[/code]

there?

Why shoudl I set a persistant class inside the DAO?

regards,
sim085


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.