-->
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.  [ 2 posts ] 
Author Message
 Post subject: Newbie question
PostPosted: Sun Feb 13, 2005 8:21 pm 
Newbie

Joined: Sun Feb 13, 2005 6:00 pm
Posts: 1
Hello,

I have a newbie question about Hibernate, as I don't know your tool still. I used to work on JDO implementations and they perform very well but I ran into problems when trying to use JDO in J2EE apps. That's why I am looking at Hibernate and want to get some basic info.

Well, can you comment on my use case?

I have an application that has one central database and remote clients - some of them have embeded databases with subset of central db's data, some don't have any db and work online.

Now, I want to perform very basic operation. Take an object list from server, edit them (CRUD) - add, delete, update some of them. Then send them back to server and server should perform all operations to persist the changes.

Seems simple? Well, to the hell, I cannot make it working for a long time.

Now. The objects I edit have some other objects connected, taken from db (for example properties that are in dictionaries and so on). So I want to load the graph of objects - or subset of this graph (only fields that needed to be shown in client app) and transfer to the client app. On client app, the user changes some of the objects. Then I want to send all graph back. For simplicity, lets assume I don't delete any objects in this use case.

Now - does Hibernate automate such an operation? In JDO it looks very simple (looks but doesn't work hehe). I just take the interesting objects by simple query. I detach them from db (and all associated dictionary fields are detached automaticly) and just return object graph from EJB. On the client side, I edit data as normal plain java objects. Then I take the object collection and send back to EJB. In EJB I can persist the changes. But here come problems - there are problems with recognition which objects are new and have to be stored in db, which are edited and need to be updated and so on.

How such a case would be done in Hibernate? How Hibernate recognizes which objects from the graph it has to write to db and which of them not? Is there any simple example of such funcionality to see?

And one question more - does Hibernate work without managed environment (application server)?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Feb 13, 2005 8:26 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Yes, Hibernate does this.


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