This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of The Career Toolkit and have Mark Herschberg on-line!
See this thread for details.
Win a copy of The Career Toolkit this week in the Jobs Discussion forum!
  • 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Simple Hibernate Example with Inner Classes

 
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simple Inner Class Example

This is the simplest stand-alone example of inner classes in Hibernate that I could cook up.

This example is very similar to the Container example I posted earlier. The only substantive difference is that the Container class and the Contained class are inner classes in HibernateExample.java.

The only trick to this example is that the inner classes must be declared static. Other than that, Hibernate just sees the inner classes as ordinary classes, and there really is nothing to this example. Sorry it's so boring, but this example answered questions I had about Hibernate and inner classes, so I suppose somebody else might have similar questions.

Notice: This is provided with no warranty whatsoever. Use at your own risk.

This is the example:
 
Alas, poor Yorick, he knew this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic