-->
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: Why foriegn keys, tables, rows mentioned?
PostPosted: Wed Oct 19, 2005 4:27 am 
Beginner
Beginner

Joined: Wed Oct 19, 2005 4:11 am
Posts: 48
I'm new to this whole O/R mapping world (not inexperienced in OO though: C++ since 1989 and Java since 1995) and I am a little surprised to see so much mention of foreign keys, joins, tables, rows etc. in the Hibernate world. I thought the idea of an O/R mapper was that you could go along on your merry OO modeling way and be shielded from all this low level stuff in the RDBMS domain. I thought I would not have to worry about such low level things anymore. These are the very things that I am searching for tools like Hibernate to help me escape from!

Maybe I'm just expecting to much but I really was hoping to just create a few classes in some visual class diagramming tool, set up inheritence, implements and association type relationships between them and then get it to bang out some java files, fill out the method bodies and voila!

Am I asking too much? Is what I'm asking really only available in some pure, popular, cheap (or free), well supported Object Database (which doesn't exist as far as I can see).

I'm coming at the problem from the angle of not having any legacy RDBMS to interface to - the whole project is being created from scratch so maybe that makes my needs different to most.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 20, 2005 10:53 am 
Newbie

Joined: Mon Oct 17, 2005 3:42 pm
Posts: 17
Hibernate actually does a pretty good job of hiding all these details in most cases. If you tell it to generate the schema it will generate them and your OO code will operate pretty much as you'd expect.

However, in larger or more complex projects, there can still be some impacts from the underlying relational constructs. So when people run into issues, you're liable to see a lot of discussion of this.

Another thing to bear in mind is that there are differences between good object models and good relational models. Hibernate has the ability to bridge that gap to a great extent, but doing things 'right' in both areas takes knowledge of both areas.

If I were you, doing greenfield development, I'd just build my POJOs and use either the EJB3 persistence or Hibernate annotations to persitence enable them, let Hibernate build my schema (setting the hbm2ddl to update seems to be working pretty well in one of my personal projects) and not worry about it.

This advise goes out the window, however, if the project is large or has a lot of legacy integration or reporting requirements (my work projects for example). These sorts of projects are much more sensitive to the underlying data model (even if they are greenfield)

hth,
danch


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 22, 2005 3:16 am 
Beginner
Beginner

Joined: Wed Oct 19, 2005 4:11 am
Posts: 48
Thanks, that has really helped me work out a game plan with Hibernate.

I am doing greenfield development (lucky me!) so I'll put the blindfolds on and set up "schema auto update" and let go of the reins of my bucking bronco and live in ignorant bliss until I discover some show stopper issue...

...then I'll probably post another message to the forum!

Thanks again.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 04, 2005 5:26 am 
Beginner
Beginner

Joined: Wed Oct 19, 2005 4:11 am
Posts: 48
Call me an OO purist, but I really wanted to be able to use Hibernate and a relational database pretty much without having to do much extra work at all (ok call me lazy too - but as we all know: a lazy programmer is a good programmer because he/she will go to amazing lengths to achieve as much reusability as possible and to automate routine, mechanical tasks!).

So I convinced the people here to allow me to spend some time adding a Hibernate persistence plugin to our Javelin Object Modeler/Coder and now all my mapping files are all created and managed automagically.

It turned out that Javelin's internal meta model used to store information about the object model already contained 99% of what was needed to generate the mapping files: classes, attributes, relationships, role names etc., (and much that wasn't needed). This information could all be used as is to make intuitive mapping decisions.

I've added a few extra points in the UI where you can customize certain Hibernate specific options and have enhanced the internal meta model to enable it to handle further customizations should users express the need in the future. In all it only took me about 1 week to write the plug in so everyone here is pretty damn well happy (they're happy that I have only spent 1 week and not 3 months on one of my crazy ideas!)

So now when I'm using Javelin for our internal stuff it's almost as if I'm using an almost transparent object oriented database with no impedence mismatch instead of a relational database because the mappings are all handled in zero time with zero effort.

If anyone wants to try it we're giving away free licenses to the latest release Javelin 7 to the Hibernate community. That's right free! Not for an evaluation - this is the real full version (just had to clarify that because a few people emailed saying their IT departments thought that it might be just a trial or cut down version).

We are offering the free licenses to the Hibernate Community and the only thing we hope to get in return is some useful feedback regarding the new Hibernate plug in and hence evolve an ideal solution for OO purists like myself. The free license covers all future 7.x releases (the recent Javelin 6.x series lasted for nearly 4 years!)

To download or read more about Javelin:
http://stepaheadsoftware.com/products/javelin/javelin.htm

To obtain your free license and unlock key to convert the evaluation in to the full version:

Fill out the form at the following ordering page. In the comment section enter: "Hibernate community". This is the only purchase link that will offer a $0.00 license:

http://www.stepaheadsoftware.com/ordering/servlet/DisplayOrder?productCode=JAV01

Note: Ignore information about secure payment options - as the price is zero you will not be asked for to make any payment.

_________________
Chris Colman
http://stepaheadsoftware.com/products/j ... avelin.htm
Javelin: Lightweight, non intrusive, POJO, Java modeling & coding with automatic Hibernate and JDO meta data generation.
Don't forget to credit ;)


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.