- Write hibernate hbm files and generate code and db-scripts from them.
- Create db-scripts from the data-model and reverse engineer this schema to generate hibernate classes and hbm files
At the moment we decided that we want to keep a close grip on what gets created inside db, so we went ahead with the second approach. After some use it looks like, we're taking alot of pain in work-arounds to not to touch generated java code(so that we can change data model anytime and regenerate the code). Let us see if this approach works out fine or if at some point we switch to 1st approach and start modifying the hbm files and generate db-scripts from them.
Himanshu,
ReplyDeletemy 2 cents, but you should be talking to your architect, rather than struggle with this monstrosity of an approach to ORM.
This whole sequence is broken in so many ways. Talk to me off line if you need more clarification.
Once you come to a choice point with the two options above (and as I said above the sequence is broken). option *1* is the correct one, not option 2.
This part "From this domain model we created a ER diagram and from there a db data model." is really scary! ;-)
fwiw. my 2 cents.
"option *1* is the correct one, not option 2."
ReplyDeleteAdd "partly" as a qualifier!
Hey Ravi, Thanks for the pointers. We've also had the same feeling that *option-1* is THE right approach. As we go along we plan to switch our strategy from option-2 to option-1 that is down the line, we'll start working directly on the generated java classes & hbm files and generate db scripts from them.
ReplyDeleteRegarding domain-model->ER-diagram->data-model, I don't know if its right or wrong but seems to have worked in our case ;-)
"option-1* is THE right approach. "
ReplyDeleteGiven that you come to that choice point! You don't need to :-)
"we'll start working directly on the generated java classes & hbm files and generate db scripts from them."
This is (almost) gobbledegook, but since you guys want to proceed this way, let's leave it at that. I'll speak to you 6 months later :-D
"Regarding domain-model->ER-diagram->data-model, I don't know if its right or wrong but seems to have worked in our case ;-)"
I like the ;-)!
;-)
looks like we're gonna learn a few lessons down the road the hard way... ;)
ReplyDelete