|
Lines 12-18
Link Here
|
| 12 |
import java.text.Collator; |
12 |
import java.text.Collator; |
| 13 |
|
13 |
|
| 14 |
import org.eclipse.datatools.modelbase.dbdefinition.PredefinedDataTypeDefinition; |
14 |
import org.eclipse.datatools.modelbase.dbdefinition.PredefinedDataTypeDefinition; |
|
|
15 |
import org.eclipse.datatools.modelbase.sql.datatypes.CharacterStringDataType; |
| 15 |
import org.eclipse.datatools.modelbase.sql.datatypes.DataType; |
16 |
import org.eclipse.datatools.modelbase.sql.datatypes.DataType; |
|
|
17 |
import org.eclipse.datatools.modelbase.sql.datatypes.ExactNumericDataType; |
| 18 |
import org.eclipse.datatools.modelbase.sql.datatypes.NumericalDataType; |
| 16 |
import org.eclipse.datatools.modelbase.sql.datatypes.PredefinedDataType; |
19 |
import org.eclipse.datatools.modelbase.sql.datatypes.PredefinedDataType; |
| 17 |
import org.eclipse.datatools.modelbase.sql.datatypes.PrimitiveType; |
20 |
import org.eclipse.datatools.modelbase.sql.datatypes.PrimitiveType; |
| 18 |
import org.eclipse.jpt.db.Column; |
21 |
import org.eclipse.jpt.db.Column; |
|
Lines 47-55
Link Here
|
| 47 |
this.getConnectionProfile().columnChanged(this); |
50 |
this.getConnectionProfile().columnChanged(this); |
| 48 |
} |
51 |
} |
| 49 |
|
52 |
|
|
|
53 |
// ********** return the wrapped DTP Column ********** |
| 50 |
|
54 |
|
| 51 |
// ********** Column implementation ********** |
55 |
public org.eclipse.datatools.modelbase.sql.tables.Column getDtpColumn(){ |
|
|
56 |
return this.dtpColumn; |
| 57 |
} |
| 52 |
|
58 |
|
|
|
59 |
// ********** Column implementation ********** |
| 53 |
public String getName() { |
60 |
public String getName() { |
| 54 |
return this.dtpColumn.getName(); |
61 |
return this.dtpColumn.getName(); |
| 55 |
} |
62 |
} |
|
Lines 66-71
Link Here
|
| 66 |
return this.getTable().foreignKeyBaseColumnsContains(this); |
73 |
return this.getTable().foreignKeyBaseColumnsContains(this); |
| 67 |
} |
74 |
} |
| 68 |
|
75 |
|
|
|
76 |
public boolean isPartOfUniqueConstraint() { |
| 77 |
return this.dtpColumn.isPartOfUniqueConstraint() ; |
| 78 |
} |
| 79 |
|
| 80 |
public boolean isNullable() { |
| 81 |
return this.dtpColumn.isNullable(); |
| 82 |
} |
| 83 |
|
| 84 |
public int getPrecision(){ |
| 85 |
DataType dataType = this.dtpColumn.getDataType(); |
| 86 |
if( dataType instanceof NumericalDataType){ |
| 87 |
NumericalDataType type = (NumericalDataType)dataType; |
| 88 |
return type.getPrecision(); |
| 89 |
} |
| 90 |
return -1; |
| 91 |
} |
| 92 |
|
| 93 |
public int getScale(){ |
| 94 |
DataType dataType = this.dtpColumn.getDataType(); |
| 95 |
if( dataType instanceof ExactNumericDataType){ |
| 96 |
ExactNumericDataType type = (ExactNumericDataType)dataType; |
| 97 |
return type.getScale(); |
| 98 |
} |
| 99 |
return -1; |
| 100 |
} |
| 101 |
|
| 102 |
public int getLength() { |
| 103 |
DataType dataType = this.dtpColumn.getDataType(); |
| 104 |
if(dataType instanceof CharacterStringDataType){ |
| 105 |
CharacterStringDataType type = (CharacterStringDataType)dataType ; |
| 106 |
return type.getLength(); |
| 107 |
} |
| 108 |
return -1; |
| 109 |
} |
| 110 |
|
| 111 |
public boolean isNumeric() { |
| 112 |
DataType dataType = this.dtpColumn.getDataType(); |
| 113 |
boolean ret = dataType instanceof NumericalDataType; |
| 114 |
return ret; |
| 115 |
} |
| 116 |
|
| 69 |
public String getDataTypeName() { |
117 |
public String getDataTypeName() { |
| 70 |
DataType dataType = this.dtpColumn.getDataType(); |
118 |
DataType dataType = this.dtpColumn.getDataType(); |
| 71 |
return (dataType == null) ? null : dataType.getName(); |
119 |
return (dataType == null) ? null : dataType.getName(); |