• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Just starting with Hibernate

 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using MySQL. Do the tables need to be joined with fk indexes in MySQL, or do you manage all the relationships within Hibernate?
(Using MyEclipse).
thanks
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Regardless of how you access your data, the data model is key. Define constraints there and you can trust your data to stay consistant regardless of what client applications access it.
 
Nigel Shrin
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul - I ask because my first attempt at Hibernate has issues with composite ids and foreign keys, so I am not sure yet at what level the problem exists.
Cheers,
 
Paul Sturrock
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Generally composite ids complicate data modelling, and there is no real need for them. If you can change your data model I would recommend adding surrogate keys and defining unique indices to replace the composite keys. Things will be much cleaner and easy to use that way.
 
Nigel Shrin
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's worked thanks Paul! changed the DB structure and now have Hibernate up and running in MyEclipse.

I'm just starting JSP/Hibernate, no JSP yet, are you able to recommend a resource?

The project is a website with a lot of interaction with a MySQL db.

thanks again


 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic