当前位置: 首页>>代码示例>>Java>>正文


Java DBObject类代码示例

本文整理汇总了Java中org.insightech.er.editor.model.dbimport.DBObject的典型用法代码示例。如果您正苦于以下问题:Java DBObject类的具体用法?Java DBObject怎么用?Java DBObject使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


DBObject类属于org.insightech.er.editor.model.dbimport包,在下文中一共展示了DBObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getText

import org.insightech.er.editor.model.dbimport.DBObject; //导入依赖的package包/类
@Override
public String getText(final Object element) {
    final TreeNode treeNode = (TreeNode) element;

    final Object value = treeNode.getValue();
    if (value instanceof DBObject) {
        final DBObject dbObject = (DBObject) value;
        return dbObject.getName();

    } else if (value instanceof StringObjectModel) {
        final StringObjectModel object = (StringObjectModel) value;
        return object.getName();

    } else if (value instanceof TestData) {
        final TestData testData = (TestData) value;
        return testData.getName();

    }

    return value.toString();
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:22,代码来源:ViewLabelProvider.java

示例2: perfomeOK

import org.insightech.er.editor.model.dbimport.DBObject; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void perfomeOK() throws InputException {
    final Object[] selectedNodes = viewer.getCheckedElements();

    resultSelectedDbObjects = new ArrayList<DBObject>();

    for (int i = 0; i < selectedNodes.length; i++) {
        final Object value = ((TreeNode) selectedNodes[i]).getValue();

        if (value instanceof DBObject) {
            resultSelectedDbObjects.add((DBObject) value);
        }
    }

    resultMergeWord = mergeWordButton.getSelection();
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:20,代码来源:AbstractSelectImportedObjectDialog.java

示例3: initialize

import org.insightech.er.editor.model.dbimport.DBObject; //导入依赖的package包/类
private void initialize(final Composite parent) {
    final DBObjectSet dbObjects = new DBObjectSet();
    dbObjects.add(new DBObject("schema", "a", DBObject.TYPE_TABLE));
    dbObjects.add(new DBObject("schema", "b", DBObject.TYPE_TABLE));
    dbObjects.add(new DBObject("schema", "c", DBObject.TYPE_TABLE));
    dbObjects.add(new DBObject("schema", "a", DBObject.TYPE_SEQUENCE));
    dbObjects.add(new DBObject("schema", "b", DBObject.TYPE_SEQUENCE));
    dbObjects.add(new DBObject("schema", "c", DBObject.TYPE_SEQUENCE));
    dbObjects.add(new DBObject("schema", "a", DBObject.TYPE_VIEW));
    dbObjects.add(new DBObject("schema", "b", DBObject.TYPE_VIEW));
    dbObjects.add(new DBObject("schema", "c", DBObject.TYPE_VIEW));

    final SelectImportedObjectFromDBDialog dialog = new SelectImportedObjectFromDBDialog(shell, null, dbObjects, null);

    dialog.open();
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:17,代码来源:SequenceTest.java

示例4: getText

import org.insightech.er.editor.model.dbimport.DBObject; //导入依赖的package包/类
@Override
public String getText(Object element) {
	TreeNode treeNode = (TreeNode) element;

	Object value = treeNode.getValue();
	if (value instanceof DBObject) {
		DBObject dbObject = (DBObject) value;
		return dbObject.getName();

	} else if (value instanceof StringObjectModel) {
		StringObjectModel object = (StringObjectModel) value;
		return object.getName();

	} else if (value instanceof TestData) {
		TestData testData = (TestData) value;
		return testData.getName();

	}

	return value.toString();
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:22,代码来源:ViewLabelProvider.java

示例5: perfomeOK

import org.insightech.er.editor.model.dbimport.DBObject; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void perfomeOK() throws InputException {
	Object[] selectedNodes = this.viewer.getCheckedElements();

	this.resultSelectedDbObjects = new ArrayList<DBObject>();

	for (int i = 0; i < selectedNodes.length; i++) {
		Object value = ((TreeNode) selectedNodes[i]).getValue();

		if (value instanceof DBObject) {
			resultSelectedDbObjects.add((DBObject) value);
		}
	}

	this.resultMergeWord = this.mergeWordButton.getSelection();
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:20,代码来源:AbstractSelectImportedObjectDialog.java

示例6: createTopNode

import org.insightech.er.editor.model.dbimport.DBObject; //导入依赖的package包/类
protected TreeNode createTopNode(String objectType,
		List<DBObject> dbObjectList) {
	TreeNode treeNode = new TreeNode(new StringObjectModel(
			ResourceString.getResourceString("label.object.type."
					+ objectType)));
	List<TreeNode> objectNodeList = new ArrayList<TreeNode>();

	for (DBObject dbObject : dbObjectList) {
		TreeNode objectNode = new TreeNode(dbObject);
		objectNode.setParent(treeNode);

		objectNodeList.add(objectNode);
	}

	treeNode.setChildren(objectNodeList.toArray(new TreeNode[objectNodeList
			.size()]));

	return treeNode;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:20,代码来源:AbstractSelectImportedObjectDialog.java

示例7: initialize

import org.insightech.er.editor.model.dbimport.DBObject; //导入依赖的package包/类
private void initialize(Composite parent) {
	DBObjectSet dbObjects = new DBObjectSet();
	dbObjects.add(new DBObject("schema", "a", DBObject.TYPE_TABLE));
	dbObjects.add(new DBObject("schema", "b", DBObject.TYPE_TABLE));
	dbObjects.add(new DBObject("schema", "c", DBObject.TYPE_TABLE));
	dbObjects.add(new DBObject("schema", "a", DBObject.TYPE_SEQUENCE));
	dbObjects.add(new DBObject("schema", "b", DBObject.TYPE_SEQUENCE));
	dbObjects.add(new DBObject("schema", "c", DBObject.TYPE_SEQUENCE));
	dbObjects.add(new DBObject("schema", "a", DBObject.TYPE_VIEW));
	dbObjects.add(new DBObject("schema", "b", DBObject.TYPE_VIEW));
	dbObjects.add(new DBObject("schema", "c", DBObject.TYPE_VIEW));

	SelectImportedObjectFromDBDialog dialog = new SelectImportedObjectFromDBDialog(
			shell, null, dbObjects, null);

	dialog.open();
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:18,代码来源:SequenceTest.java

示例8: cacheColumnData

import org.insightech.er.editor.model.dbimport.DBObject; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void cacheColumnData(final List<DBObject> dbObjectList, final ProgressMonitor monitor) throws SQLException, InterruptedException {
    super.cacheColumnData(dbObjectList, monitor);

    PreparedStatement stmt = null;
    ResultSet rs = null;

    try {
        stmt = con.prepareStatement("SELECT OWNER, TABLE_NAME, COLUMN_NAME, COMMENTS FROM SYS.ALL_COL_COMMENTS WHERE COMMENTS IS NOT NULL");
        rs = stmt.executeQuery();

        while (rs.next()) {
            String tableName = rs.getString("TABLE_NAME");
            final String schema = rs.getString("OWNER");

            final String columnName = rs.getString("COLUMN_NAME");
            final String comments = rs.getString("COMMENTS");

            tableName = dbSetting.getTableNameWithSchema(tableName, schema);

            final Map<String, ColumnData> cache = columnDataCache.get(tableName);
            if (cache != null) {
                final ColumnData columnData = cache.get(columnName);
                if (columnData != null) {
                    columnData.description = comments;
                }
            }
        }

    } finally {
        this.close(rs);
        this.close(stmt);
    }
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:38,代码来源:OracleTableImportManager.java

示例9: createTopNode

import org.insightech.er.editor.model.dbimport.DBObject; //导入依赖的package包/类
protected TreeNode createTopNode(final String objectType, final List<DBObject> dbObjectList) {
    final TreeNode treeNode = new TreeNode(new StringObjectModel(ResourceString.getResourceString("label.object.type." + objectType)));
    final List<TreeNode> objectNodeList = new ArrayList<TreeNode>();

    for (final DBObject dbObject : dbObjectList) {
        final TreeNode objectNode = new TreeNode(dbObject);
        objectNode.setParent(treeNode);

        objectNodeList.add(objectNode);
    }

    treeNode.setChildren(objectNodeList.toArray(new TreeNode[objectNodeList.size()]));

    return treeNode;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:16,代码来源:AbstractSelectImportedObjectDialog.java

示例10: createTreeNodeList

import org.insightech.er.editor.model.dbimport.DBObject; //导入依赖的package包/类
@Override
protected List<TreeNode> createTreeNodeList() {
    final List<TreeNode> treeNodeList = super.createTreeNodeList();

    TreeNode topNode = createTopNode(DBObject.TYPE_NOTE, dbObjectSet.getNoteList());
    treeNodeList.add(topNode);
    topNode = createTopNode(DBObject.TYPE_GROUP, dbObjectSet.getGroupList());
    treeNodeList.add(topNode);

    return treeNodeList;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:12,代码来源:SelectImportedObjectFromFileDialog.java

示例11: cacheColumnData

import org.insightech.er.editor.model.dbimport.DBObject; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void cacheColumnData(List<DBObject> dbObjectList,
		ProgressMonitor monitor) throws SQLException, InterruptedException {
	super.cacheColumnData(dbObjectList, monitor);

	PreparedStatement stmt = null;
	ResultSet rs = null;

	try {
		stmt = this.con
				.prepareStatement("SELECT OWNER, TABLE_NAME, COLUMN_NAME, COMMENTS FROM SYS.ALL_COL_COMMENTS WHERE COMMENTS IS NOT NULL");
		rs = stmt.executeQuery();

		while (rs.next()) {
			String tableName = rs.getString("TABLE_NAME");
			String schema = rs.getString("OWNER");

			String columnName = rs.getString("COLUMN_NAME");
			String comments = rs.getString("COMMENTS");

			tableName = this.dbSetting.getTableNameWithSchema(tableName,
					schema);

			Map<String, ColumnData> cache = this.columnDataCache
					.get(tableName);
			if (cache != null) {
				ColumnData columnData = cache.get(columnName);
				if (columnData != null) {
					columnData.description = comments;
				}
			}
		}

	} finally {
		this.close(rs);
		this.close(stmt);
	}
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:42,代码来源:OracleTableImportManager.java

示例12: createTreeNodeList

import org.insightech.er.editor.model.dbimport.DBObject; //导入依赖的package包/类
@Override
protected List<TreeNode> createTreeNodeList() {
	List<TreeNode> treeNodeList = super.createTreeNodeList();

	TreeNode topNode = createTopNode(DBObject.TYPE_NOTE,
			this.dbObjectSet.getNoteList());
	treeNodeList.add(topNode);
	topNode = createTopNode(DBObject.TYPE_GROUP,
			this.dbObjectSet.getGroupList());
	treeNodeList.add(topNode);

	return treeNodeList;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:14,代码来源:SelectImportedObjectFromFileDialog.java

示例13: cacheColumnData

import org.insightech.er.editor.model.dbimport.DBObject; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void cacheColumnData(List<DBObject> dbObjectList,
		ProgressMonitor monitor) throws SQLException, InterruptedException {
	super.cacheColumnData(dbObjectList, monitor);

	PreparedStatement stmt = null;
	ResultSet rs = null;

	try {
		stmt = con.prepareStatement("SELECT NULL AS OWNER, TABLE_NAME, COLUMN_NAME, DESCRIPTION AS COMMENTS FROM _CUB_SCHEMA_COMMENTS a, DB_ATTRIBUTE b WHERE a.COLUMN_NAME = b.ATTR_NAME AND a.TABLE_NAME = b.CLASS_NAME");
		rs = stmt.executeQuery();

		while (rs.next()) {
			String tableName = rs.getString("TABLE_NAME");
			String schema = rs.getString("OWNER");

			String columnName = rs.getString("COLUMN_NAME");
			String comments = rs.getString("COMMENTS");

			tableName = this.dbSetting.getTableNameWithSchema(tableName, schema);

			Map<String, ColumnData> cache = this.columnDataCache.get(tableName);
			if (cache != null) {
				ColumnData columnData = cache.get(columnName);
				if (columnData != null) {
					columnData.description = comments;
				}
			}
		}
	} finally {
		this.close(rs);
		this.close(stmt);
	}
}
 
开发者ID:justinkwony,项目名称:ermaster-nhit,代码行数:38,代码来源:CUBRIDTableImportManager.java

示例14: importSequences

import org.insightech.er.editor.model.dbimport.DBObject; //导入依赖的package包/类
@Override
protected List<DBObject> importSequences() throws SQLException {
    final List<DBObject> list = new ArrayList<DBObject>();

    ResultSet resultSet = null;
    PreparedStatement stmt = null;

    if (schemaList.isEmpty()) {
        schemaList.add(null);
    }

    for (final String schemaPattern : schemaList) {
        try {
            if (schemaPattern == null) {
                stmt = con.prepareStatement("SELECT SEQSCHEMA, SEQNAME FROM SYSIBM.SYSSEQUENCES");

            } else {
                stmt = con.prepareStatement("SELECT SEQSCHEMA, SEQNAME FROM SYSIBM.SYSSEQUENCES WHERE SEQSCHEMA = ?");
                stmt.setString(1, schemaPattern);
            }

            resultSet = stmt.executeQuery();

            while (resultSet.next()) {
                final String schema = resultSet.getString("SEQSCHEMA");
                final String name = resultSet.getString("SEQNAME");

                final DBObject dbObject = new DBObject(schema, name, DBObject.TYPE_SEQUENCE);
                list.add(dbObject);
            }

        } finally {
            if (resultSet != null) {
                resultSet.close();
                resultSet = null;
            }
            if (stmt != null) {
                stmt.close();
                stmt = null;
            }
        }
    }

    return list;

}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:47,代码来源:DB2PreTableImportManager.java

示例15: cacheColumnData

import org.insightech.er.editor.model.dbimport.DBObject; //导入依赖的package包/类
@Override
protected void cacheColumnData(final List<DBObject> dbObjectList, final ProgressMonitor monitor) throws SQLException, InterruptedException {
    super.cacheColumnData(dbObjectList, monitor);

    PreparedStatement ps = null;
    ResultSet rs = null;

    final String sql = "SELECT T.TABLE_NAME, T.TABLE_COLLATION, C.COLUMN_NAME, " + "C.CHARACTER_SET_NAME, C.COLLATION_NAME, C.COLUMN_TYPE " + "FROM INFORMATION_SCHEMA.TABLES T, INFORMATION_SCHEMA.COLUMNS C " + "WHERE T.TABLE_SCHEMA = ? AND T.TABLE_NAME = C.TABLE_NAME";

    try {
        ps = con.prepareStatement(sql);

        ps.setString(1, dbSetting.getDatabase());
        rs = ps.executeQuery();

        while (rs.next()) {
            final String tableName = rs.getString("TABLE_NAME");
            final String columnName = rs.getString("COLUMN_NAME");
            final String tableCollation = Format.null2blank(rs.getString("TABLE_COLLATION"));
            String tableCharacterSet = "";
            final String characterSet = Format.null2blank(rs.getString("CHARACTER_SET_NAME"));
            final String collation = Format.null2blank(rs.getString("COLLATION_NAME"));

            // String type = Format.null2blank(rs.getString("COLUMN_TYPE"));

            if (!tableCollation.isEmpty()) {
                final int index = tableCollation.indexOf("_");
                if (index != -1) {
                    tableCharacterSet = tableCollation.substring(0, index);
                }
            }

            MySQLTableProperties tableProperties = tablePropertiesMap.get(tableName);
            if (tableProperties == null) {
                tableProperties = new MySQLTableProperties();

                tableProperties.setCharacterSet(tableCharacterSet);
                tableProperties.setCollation(tableCollation);

                tablePropertiesMap.put(tableName, tableProperties);
            }

            final Map<String, ColumnData> columnDataMap = columnDataCache.get(tableName);
            final ColumnData columnData = columnDataMap.get(columnName);

            if (columnData != null) {
                if (!tableCharacterSet.equals(characterSet)) {
                    columnData.characterSet = characterSet;
                }

                if (!tableCollation.equals(collation)) {
                    columnData.collation = collation;
                }

                if (collation.endsWith("_bin")) {
                    columnData.isBinary = true;
                }
            }
        }

    } finally {
        if (rs != null) {
            rs.close();
        }
        if (ps != null) {
            ps.close();
        }
    }

}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:71,代码来源:MySQLTableImportManager.java


注:本文中的org.insightech.er.editor.model.dbimport.DBObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。