1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- package com.persistence.DBdll.adapter.assitant.DbIsModify;
- import com.persistence.DBdll.adapter.assitant.ColumnInfo;
- import com.sysmodel.datamodel.Parameter.XmlManagerPara;
- public class OracleColumnAdp extends ColumnAdp{
- @Override
- public boolean isModifyByDatatypeAndColumnInfo(String datatype, String xmlScale,
- int xmlPrecision, ColumnInfo columninfo) {
- if (datatype.equals(XmlManagerPara.hudgestring)) {
- if (columninfo.getColumnTypeName().equals("CLOB"))
- return false;
- else
- return true;
- } else if (datatype.equals(XmlManagerPara.date)) {
- if (columninfo.getColumnTypeName().equals("DATE"))
- return false;
- else
- return true;
- } else if (datatype.equals(XmlManagerPara.image)) {
- if (columninfo.getColumnTypeName().equals("VARCHAR2")
- && columninfo.getPrecision() == 100)
- return false;
- else
- return true;
- } else if (datatype.equals(XmlManagerPara.number)) {
- if (columninfo.getColumnTypeName().equals("NUMBER")
- && columninfo.getPrecision() == xmlPrecision
- && (xmlScale.equals("") || xmlScale
- .equals(String.valueOf(columninfo.getScale()))))
- return false;
- else
- return true;
- } else if (datatype.equals(XmlManagerPara.bool)) {
- if (columninfo.getColumnTypeName().equals("NUMBER"))
- return false;
- else
- return true;
- } else if (datatype.equals(XmlManagerPara.string)) {
- boolean bresult = false;
- if (columninfo.getPrecision() != xmlPrecision)
- bresult = true;
- if (xmlPrecision < 50 && !columninfo.getColumnTypeName().equals("VARCHAR2"))
- bresult = true;
- if (xmlPrecision >= 50 && xmlPrecision <= 2000
- && !columninfo.getColumnTypeName().equals("NVARCHAR2"))
- bresult = true;
- return bresult;
- }
- return true;
- }
- }
|