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


Java SQLObjectRuntimeException类代码示例

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


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

示例1: getCachedColumn

import ca.sqlpower.sqlobject.SQLObjectRuntimeException; //导入依赖的package包/类
/**
 * Attempts to resolve the given column name to a column of the owning Project
 * object's source table. This functionality is provided for the benefit of
 * the ORM layer, which has difficulty using the business model.
 * <p>
 * WARNING: This method has the side effect of calling setColumn() the first
 * time you call it and columnName isn't null. The values of cachedColumn and
 * columnName may be modified, and if so, a change event will be fired.
 * 
 * @throws NullPointerException
 *             if any of the business objects required for resolving the
 *             column object are missing
 * @throws SQLObjectRuntimeException
 *             if getColumnByName fails
 */
@Accessor
public SQLColumn getCachedColumn() {
    if (cachedColumn != null) return cachedColumn;
    if (columnName == null) return null;
    
    try {
        SQLTable st = getTable();
        if (st == null) throw new NullPointerException("The table owner has no source table specified");
        SQLColumn newColumn = st.getColumnByName(columnName);

        // did we actually make it here?
        SQLColumn oldVal = this.cachedColumn;
        this.cachedColumn = newColumn;
        this.columnName = (newColumn == null ? null : newColumn.getName());

        return newColumn;
        
    } catch (SQLObjectException ex) {
        throw new SQLObjectRuntimeException(ex);
    }
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:37,代码来源:CachableColumn.java

示例2: validate

import ca.sqlpower.sqlobject.SQLObjectRuntimeException; //导入依赖的package包/类
public ValidateResult validate(Object contents) {

			SQLTable value = (SQLTable)contents;
			if ( value == null ) {
                enableAction(false);
				return ValidateResult.createValidateResult(Status.FAIL,
						"Project source table is required");
			}
			else {
				try {
					value.populate();
				} catch (SQLObjectException e) {
					throw new SQLObjectRuntimeException(e);
				}
				enableAction(true);

			}
			return ValidateResult.createValidateResult(Status.OK, "");
		}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:20,代码来源:ProjectEditor.java

示例3: setUp

import ca.sqlpower.sqlobject.SQLObjectRuntimeException; //导入依赖的package包/类
protected void setUp() throws Exception {
project = new Project();

ds = getDS();
db = new SQLDatabase(ds);
session = new TestingMatchMakerSession() {

	@Override
	public Connection getConnection() {
		try {
			return db.getConnection();
		} catch (SQLObjectException e) {
			throw new SQLObjectRuntimeException(e);
		}
	}
};
session.setDatabase(db);

project.setSession(session);
con = db.getConnection();
session.setConnection(con);

project.setType(ProjectMode.CLEANSE);

//This is different for Oracle and SQL Server
createTables();
step = new SQLInputStep();

MungeSettings settings = new MungeSettings();
File file = File.createTempFile("cleanseTest", "log");
settings.setLog(file);
settings.copyPropertiesToTarget(project.getMungeSettings());
engine = new CleanseEngineImpl(session, project);
 	}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:35,代码来源:AbstractCleanseEngineImplTest.java

示例4: ColumnComboBoxModel

import ca.sqlpower.sqlobject.SQLObjectRuntimeException; //导入依赖的package包/类
/**
    * Creates a combo box model for the given table.  This combo box
    * model will only work with this one table for its whole life.
    * 
    * @param table The table to use
    * @throws SQLObjectRuntimeException If the table column populate fails
    */
public ColumnComboBoxModel(SQLTable table) {
	super();
       if (table == null) throw new NullPointerException("Null table not allowed");
       this.table = table;
       try {
           for (SQLColumn c : table.getColumns()) {
               columns.add(c);
           }
       } catch (SQLObjectException ex) {
           throw new SQLObjectRuntimeException(ex);
       }
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:20,代码来源:ColumnComboBoxModel.java

示例5: duplicate

import ca.sqlpower.sqlobject.SQLObjectRuntimeException; //导入依赖的package包/类
/**
 * Creates a new table merge rules with the parent and session that 
 * are passed in.
 * 
 * It makes a copy of all non mutable objects.  Except the index when the
 * index is the default index on the table.
 */
public TableMergeRules duplicate(MatchMakerObject parent) {
	TableMergeRules newMergeStrategy = new TableMergeRules();
	newMergeStrategy.setParent(parent);
	newMergeStrategy.setName(getName());
	newMergeStrategy.setTableName(getTableName());
	newMergeStrategy.setSpDataSource(getSpDataSourceName());
	newMergeStrategy.setCatalogName(getCatalogName());
	newMergeStrategy.setSchemaName(getSchemaName());
	newMergeStrategy.setParentMergeRule(getParentMergeRule());
	newMergeStrategy.setChildMergeAction(getChildMergeAction());
	newMergeStrategy.setVisible(isVisible());
	try {
		if (tableIndex.isUserCreated()) {
			newMergeStrategy.setTableIndex(new SQLIndex(getTableIndex()));
		} else {
			newMergeStrategy.setTableIndex(getTableIndex());
		}
	} catch (SQLObjectException e) {
		throw new SQLObjectRuntimeException(e);
	}

	for (ColumnMergeRules c : (getChildren(ColumnMergeRules.class))) {
		ColumnMergeRules newColumnMergeRules = c.duplicate(newMergeStrategy);
		newMergeStrategy.addChild(newColumnMergeRules);
	}
	return newMergeStrategy;
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:35,代码来源:TableMergeRules.java

示例6: setUp

import ca.sqlpower.sqlobject.SQLObjectRuntimeException; //导入依赖的package包/类
@Override
protected void setUp() throws Exception {
    JDBCDataSource dataSource = DBTestUtil.getHSQLDBInMemoryDS();
	db = new SQLDatabase(dataSource);
	con = db.getConnection();

	MMTestUtils.createResultTable(con);
	MMTestUtils.createSourceTable(con);

	SQLSchema plSchema = db.getSchemaByName("pl");

	resultTable = db.getTableByName(null, "pl", "match_results");
	sourceTable = db.getTableByName(null, "pl", "source_table");
	
	SQLIndex sourceTableIndex = new SQLIndex("SOURCE_PK", true, null, null, null);
	sourceTableIndex.addChild(new Column(sourceTable.getColumn(0), AscendDescend.UNSPECIFIED));
	sourceTable.addIndex(sourceTableIndex);

	plSchema.addChild(sourceTable);

	MatchMakerSession session = new StubMatchMakerSession() {
		@Override
		public Connection getConnection() {
			try {
				return db.getConnection();
			} catch (SQLObjectException e) {
				throw new SQLObjectRuntimeException(e);
			}
		}
		
		@Override
		public <T extends MatchMakerObject> MatchMakerDAO<T> getDAO(Class<T> businessClass) {
	        return new StubMatchMakerDAO<T>(businessClass);
	    }
	};

	project = new Project();
	project.setSession(session);
	project.setResultTable(resultTable);
	project.setSourceTable(sourceTable);
	project.setSourceTableIndex(sourceTableIndex);

	mungeProcessOne = new MungeProcess();
	mungeProcessOne.setName("Munge_Process_One");
	project.addChild(mungeProcessOne);

	mungeProcessTwo = new MungeProcess();
	mungeProcessTwo.setName("Munge_Process_Two");
	project.addChild(mungeProcessTwo);
	
	MMTestUtils.createTestingPool(session, project, mungeProcessOne, mungeProcessTwo);
	
	pool = project.getMatchPool();
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:55,代码来源:MatchPoolTest.java


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