Code example for Table

Methods: setCatalogsetNamesetSchema

0
			if(foreignTableName!=null) {
				List localColumns = new ArrayList();
				localColumns.add(column);
				List foreignColumns = new ArrayList();
				 
				Table foreignTable = new Table();
				foreignTable.setName(foreignTableName);
				foreignTable.setCatalog(getValue(element.attributeValue( "foreign-catalog"),table.getCatalog()) );
				foreignTable.setSchema(getValue(element.attributeValue( "foreign-schema"), table.getSchema()) );
				 
				String foreignColumnName = element.attributeValue("foreign-column");
				if(foreignColumnName!=null) {
					Column foreignColumn = new Column();
					foreignColumn.setName(foreignColumnName);
					foreignColumns.add(foreignColumn);
				}  
				else { 
					throw new MappingException("foreign-column is required when foreign-table is specified on " + column);
				}