开发者

At run time how to I verify that the database schema matches my objects?

开发者 https://www.devze.com 2022-12-21 03:38 出处:网络
I have开发者_JAVA百科 data access object that have been generated by SqlMetal, however the database is created by running a sql script.

I have开发者_JAVA百科 data access object that have been generated by SqlMetal, however the database is created by running a sql script.

Is there an easy way to verify that all table and columns names and type matches the attributes on the classes that SqlMetal created?


I guess the easiest way to do this would be to have some kind of version number hidden in a config table in your schema. Then on runtime check the version number returned.

Much easier than doing a full scan. Set the version number in your SQL script and somewhere in your data access object

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号