dafe06eb007477b5f8badc64623db435085beee8.svn-base 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. package com.persistence.DBdll.adapter.assitant.DbIsModify;
  2. import com.persistence.DBdll.adapter.assitant.ColumnInfo;
  3. import com.sysmodel.datamodel.xmlmodel.able.Property;
  4. import com.sysmodel.datamodel.xmlmodel.impl.MdpAttributeImpl;
  5. public abstract class ColumnAdp{
  6. /**
  7. * 判断数据库中常量表中字段是否修改
  8. *
  9. * @param imp
  10. * @param columninfo
  11. * @return
  12. */
  13. public boolean isConstantDataBaseModify(Property imp, ColumnInfo columninfo) {
  14. String datatype = imp.getDataType();
  15. String Scale = imp.getScale();
  16. int leghth = imp.getLength();
  17. return this.isModifyByDatatypeAndColumnInfo(datatype, Scale, leghth, columninfo);
  18. }
  19. /**
  20. * 判断数据库中业务表中数据是否被修改过
  21. *
  22. * @param attribute
  23. * @param columninfo
  24. * @return
  25. */
  26. public boolean isDataBaseModify(MdpAttributeImpl attribute, ColumnInfo columninfo) {
  27. String datatype = attribute.getDataType();
  28. String Scale = attribute.getScale();
  29. int leghth = attribute.getPrecision();
  30. return this.isModifyByDatatypeAndColumnInfo(datatype, Scale, leghth, columninfo);
  31. }
  32. /**
  33. * 判断表中列在xml中的配置是否和数据库中情况一致 Checks if is modify by datatype and column info.
  34. *
  35. * @param datatype
  36. * xml中数据类型
  37. * @param Scale
  38. * the xml中格式化类型
  39. * @param leghth
  40. * the xml中字段长度定义
  41. *
  42. * @param columninfo
  43. * the columninfo 数据库中列情况对象
  44. *
  45. * @return true, if is modify by datatype and column info
  46. *
  47. * @author sun
  48. * @version 2009-8-20-12:37:20
  49. *
  50. * Checks if is modify by datatype and column info.
  51. */
  52. abstract public boolean isModifyByDatatypeAndColumnInfo(String datatype, String xmlScale,
  53. int xmlPrecision, ColumnInfo columninfo);
  54. }