I have some old code which didn’t use database. Now can database schema be auto-generated from existing classes? I know this seems reverse than usual DB to class generation.
But it would be good if there is some easy way to do so.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sure, with a little reflection you could generate some rough table creation scripts, and even stored procedures to support INSERTS/UPDATES/DELETES (if you wished).
Unless there is an exact one-to-one mapping, you will need to clean up those scripts by hand.
EDIT: to elaborate on this further (in conjunction with @TomTom’s answer)
Things that will be difficult/impossible to infer automatically:
Things that you could do automatically with a bunch of work (but better to do by hand, IMO):