29fe041125edf7a8aa884cb2066cd3fb598274a5.svn-base 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package com.persistence.DBdll.adapter.assitant.DbIsModify;
  2. import com.persistence.DBdll.adapter.assitant.ColumnInfo;
  3. import com.sysmodel.datamodel.Parameter.XmlManagerPara;
  4. public class OracleColumnAdp extends ColumnAdp{
  5. @Override
  6. public boolean isModifyByDatatypeAndColumnInfo(String datatype, String xmlScale,
  7. int xmlPrecision, ColumnInfo columninfo) {
  8. if (datatype.equals(XmlManagerPara.hudgestring)) {
  9. if (columninfo.getColumnTypeName().equals("CLOB"))
  10. return false;
  11. else
  12. return true;
  13. } else if (datatype.equals(XmlManagerPara.date)) {
  14. if (columninfo.getColumnTypeName().equals("DATE"))
  15. return false;
  16. else
  17. return true;
  18. } else if (datatype.equals(XmlManagerPara.image)) {
  19. if (columninfo.getColumnTypeName().equals("VARCHAR2")
  20. && columninfo.getPrecision() == 100)
  21. return false;
  22. else
  23. return true;
  24. } else if (datatype.equals(XmlManagerPara.number)) {
  25. if (columninfo.getColumnTypeName().equals("NUMBER")
  26. && columninfo.getPrecision() == xmlPrecision
  27. && (xmlScale.equals("") || xmlScale
  28. .equals(String.valueOf(columninfo.getScale()))))
  29. return false;
  30. else
  31. return true;
  32. } else if (datatype.equals(XmlManagerPara.bool)) {
  33. if (columninfo.getColumnTypeName().equals("NUMBER"))
  34. return false;
  35. else
  36. return true;
  37. } else if (datatype.equals(XmlManagerPara.string)) {
  38. boolean bresult = false;
  39. if (columninfo.getPrecision() != xmlPrecision)
  40. bresult = true;
  41. if (xmlPrecision < 50 && !columninfo.getColumnTypeName().equals("VARCHAR2"))
  42. bresult = true;
  43. if (xmlPrecision >= 50 && xmlPrecision <= 2000
  44. && !columninfo.getColumnTypeName().equals("NVARCHAR2"))
  45. bresult = true;
  46. return bresult;
  47. }
  48. return true;
  49. }
  50. }