• 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

ORM for normalization

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Recently I came across a database developer that didn't like to normalize. I wanted to use Hibernate to create an object representation of that data, but it was extremely difficult because things were very flat. Are there any handy tricks that anyone knows of to overcome scenarios like this? Any insight would be appreciated.
 
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your best bet may be to ditch the database developer.

If that's not possible and you can't work with him to revise the database schema, you could try creating views to provide your application with a normalized version of the data.
 
author
Posts: 4335
39
jQuery Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There are many times is it good in production environments to throw out normalization, such as when the performance hit of joining the tables vastly exceeds the performance hit of maintaining the denormalized structure.

As Scott said though, you can use Views and/or Triggers in a db environment to automate some of these tasks to make your data appear normalized or denormalized when it isn't.

Hibernate, like JDO, does support inheritence mappings (vertical, horizontal, flat) and if the data is as difficult to work with as you say, applying one of these patterns might help. Ultimately, if the data is too forgone for object mapping tools, then your best bet is to restructure it.
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I agree completely. Sometimes normalization is not desirable.

Especially when the ratio of updates to reads is very low and join performance is an issue like in a reporting application.
 
reply
    Bookmark Topic Watch Topic
  • New Topic