Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I'm learning Hibernate, and posting examples that I've created to learn it.

 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I've started learning Hibernate. It has been difficult, because I'm accustomed to learning APIs, and Hibernate is not an API (please let me know if you disagree).

What I've seen of Hibernate so far is awesome, so I want to see others using it. Toward that goal, I've decided to post simple examples of Hibernate that (hopefully) others will find helpful.

I didn't like any of the on-line documentation for Hibernate, because the examples provided are difficult to understand. They contain extraneous things like Maven, Ant, Junit, utility classes, etc. that don't clearly describe any Hibernate concept. Because of that, the examples I found require that I already know Hibernate so I can determine what is extraneous, and what is illustrating a point. Each of my examples will focus strictly on just one point, with all of the extraneous stuff stripped away. I think a typical programmer can assemble simple concepts into complicated software (after all, developing software is a matter of creating many lines of code, each of which is a simple step, and assembling them into useful software).

My examples will be self-contained and ready to run, so that if somebody has trouble making them run, they will know it is a setup problem, and not some misunderstanding of Hibernate.

Each example will be in a different post. Stay tuned.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34375
346
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a great idea! You might want to use this thread as an "index" of such posts so someone can find them all in one place.
 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simple POJO Example

See my simple example of a POJO
 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simple Container Example

See my simple container example
 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lazy Loading Example

See my example of lazy loading.
 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Eager Loading Example

See my example of eager loading
 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cascade Saving Example

See my example of cascade saving
 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simple Tree Example

See my my tree example.
 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inner classes example

See my example with inner classes.
 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Embedded Classes Example

See my example with embedded classes.
 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Example with Final Classes and Final Methods

See my example with final classes and final methods (actually it is more of a non-example).
 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Example with Enums

See my Enum example.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34375
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've created a Hibernate FAQ page with this index so the ORM forum can link to this thread from it.

Great posts!
 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Transient (Non-Persistent) Data

See my example with transient data.
 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hash Map with a Complex Key

See my example of a hash map with a complex key
 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simple HashMap Example

See my simple hashmap example.
 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
List Example

See my list example. This explains a strange time-bomb that I inadvertently created for myself.
 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Simple Hibernate Example with Primitive Arrays

See my example with primitive arrays.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic