Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using POJO classes---Is it a good programming practice?

 
shah rah
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can I use POJO classes generated from hibernate instead of creating value objects in my code. Is it a good programming practice?

 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. That is what they are for. There is nothing magical about a plain old java object.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, those classes generated by Hibernate will be POJOs.

I would just do a double check on the generated classes to make sure the properties are of the types that you want and the assocations and pk assignments are what you want.

They do a great job of generating the start of your classes, but they can't predict everything that you might want.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic