0

In the Hibernate in Action (Manning publication),

A major objective of the Hibernate project is support for fine-grained object models, which we isolated as the most important requirement for rich domain model. In crude term, fine-grained means "more classes than table".

I don't get this... Please some body help on this.

skaffman
  • 398,947
  • 96
  • 818
  • 769
Abimaran Kugathasan
  • 31,165
  • 11
  • 75
  • 105

1 Answers1

1

This refers (I think) to what Hibernate calls "components", and what JPA calls "embedded classes". See the link for an explanation of what that means.

skaffman
  • 398,947
  • 96
  • 818
  • 769
  • Thanks skaffman, but, what's the point of doing that? Ultimately, hoe do we persist the grained object? To the same table? [More classes than tables] If so, then what is the purpose of that? I don't get it. – Abimaran Kugathasan Dec 08 '10 at 11:21
  • @abimaran: The component objects are automatically "inlined" into the big table by Hibernate. It allows you to have a nice fine-grained object model without having fine-grained tables. – skaffman Dec 08 '10 at 11:32
  • 1
    For example, if we have a Person class, then there are attributes for address like, home_Location, home_City, home_Country. But, with the concept of fine-grained object, we can model it as Person class and Address class instead the person class directly have all those home_Location, home_City, home_Country address directly. But, ultimately those will be persisted to the same table. So what is the advantages of the fine-grained objects? – Abimaran Kugathasan Dec 08 '10 at 11:54
  • @abimaran: Well that's subjective, but a fine-grained object model is generally nicer to work with – skaffman Dec 08 '10 at 11:59