Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Making a smarter use of Hibernate

 
David Brossard
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi fellows cowboys,

I've been using (relying on) Hibernate for quite a while now, got my mappings right and wrote some "proxy" classes that make use of the mappings I define. It's working just fine but...

I'd like to make a smarter use of my Hibernate: mapping to better types, guaranteeing dependencies between tables in the db and so on.

For instance I have a UUID attribute of my class in Java that is stored in my db as a varchar and mapped as string. Can I possibly map to UUID instead? If so how?

I also have a table that contains a foreign key to another table. How can I ensure that Hibernate picks this up and prevents me from doing stupid things or - instead - cascade deletes items?

In other words, where can I find good tutorials that would show me how to better my use of Hibernate which has remained very basic.

Thanks,
David.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here's one link you may want to look at:

http://sandbox.sourcelabs.com/kosta/hibernate-bhw/index.html
 
David Brossard
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, I will have a good read through it.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Start reading through the wiki at www.hibernate.org. For a book, I highly recommend "Java Persistence with Hibernate"

I commend you for seeing that there is much more to Hibernate than straight mapping. There is a lot to see here and a bit to learn, but knowing how Hibernate works so you can best utilize it, is what makes Hibernate so great.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic