Search in sources :

Example 26 with TypeInstance

use of org.obeonetwork.dsl.typeslibrary.TypeInstance in project InformationSystem by ObeoNetwork.

the class CreationUtils method createTypeInstance.

public static TypeInstance createTypeInstance(NativeTypesLibrary nativeTypesLibrary, String columnType, int columnSize, int decimalDigits) {
    NativeType nativeType = nativeTypesLibrary.findTypeByName(columnType);
    if (nativeType == null) {
        System.err.println("createTypeInstance : native type [" + columnType + "] not found.");
    }
    TypeInstance typeInstance = TypesLibraryFactory.eINSTANCE.createTypeInstance();
    typeInstance.setNativeType(nativeType);
    typeInstance.setLength(columnSize);
    typeInstance.setPrecision(decimalDigits);
    return typeInstance;
}
Also used : NativeType(org.obeonetwork.dsl.typeslibrary.NativeType) TypeInstance(org.obeonetwork.dsl.typeslibrary.TypeInstance)

Aggregations

TypeInstance (org.obeonetwork.dsl.typeslibrary.TypeInstance)26 Column (org.obeonetwork.dsl.database.Column)11 NativeType (org.obeonetwork.dsl.typeslibrary.NativeType)11 Test (org.junit.Test)4 AbstractTest (org.obeonetwork.database.m2doc.services.common.AbstractTest)4 EObject (org.eclipse.emf.ecore.EObject)2 Constraint (org.obeonetwork.dsl.database.Constraint)2 Type (org.obeonetwork.dsl.typeslibrary.Type)2 ArrayList (java.util.ArrayList)1 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1 BasicEList (org.eclipse.emf.common.util.BasicEList)1 EList (org.eclipse.emf.common.util.EList)1 EObjectFlatComboSettings (org.eclipse.emf.eef.runtime.ui.widgets.eobjflatcombo.EObjectFlatComboSettings)1 Viewer (org.eclipse.jface.viewers.Viewer)1 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)1 View (org.obeonetwork.dsl.database.View)1 ColumnSpec (org.obeonetwork.dsl.database.spec.ColumnSpec)1 Attribute (org.obeonetwork.dsl.environment.Attribute)1 Literal (org.obeonetwork.dsl.environment.Literal)1