• 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

Class Structure in hibernate Question

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

I am currently learning hibernate (and am also quite new to Java in general) and have put together a few classes which link to database tables and as such there are foreign keys etc between these classes (You can see a diagram of this at the bottom of this post). Basically a quick overview of what I have done is created some classes which deal with customers who rent movies. I have my standard classes such as Movie, PriceCode, Customer as well as some others (the three I mentioned can be seen below, if you need to see the rest then I can also paste them).





I then have another class called CustomerRentalsMainApp which is going to add rentals to customers, search for movies, search for customers etc (not all are currently done but I intend to implement them shortly) but it seems like I am putting an awful lot of methods into this class, I have a populateMovie and generatePriceCode method which is just used to set up initial data but after that I have a FindMovieID method and will then be adding other methods such ass addCustomerRental etc. These are all in the one file as it requires sessions etc so as to insert them into the database but I cant help but think that I am putting a lot of methods in this class that should probably be placed in other classes more appropriate to the methodName. Ie the current findMovieID method should maybe be placed in a file which relates more to movies?


Any guidance/advice is most welcome as I am quite new to all of this.

Thanks in advance.
orm.jpg
[Thumbnail for orm.jpg]
 
reply
    Bookmark Topic Watch Topic
  • New Topic