• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Making a smarter use of Hibernate  RSS feed

 
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.
 
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.
 
ranger
Sheriff
Posts: 17314
11
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!