Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions AnalyzerBeans Copyright (C) 2010 This copyrighted material is made available to anyone wishing to use, modify, copy, or redistribute it subject to the terms and conditions of the GNU Lesser General Public License, as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this distribution; if not, write to: Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor Boston, MA 02110-1301 USA
 package org.eobjects.analyzer.beans;
 import java.util.List;
Matches values from separate tables and returns rows where the values does not match

Kasper Sørensen
 @AnalyzerBean("Join matcher")
 public class JoinMatcher implements Explorer<DataSetResult> {
 	@Configured(order = 1)
 	private Table leftTable;
 	public void setLeftTable(Table leftTable) {
 		this. = leftTable;
 	@Configured(order = 2)
 	private Table rightTable;
 	public void setRightTable(Table rightTable) {
 		this. = rightTable;
 	@Configured(order = 3)
 	public void setLeftTableJoinColumn(Column leftTableJoinColumn) {
 		this. = leftTableJoinColumn;
 	@Configured(order = 4)
 	public void setRightTableJoinColumn(Column rightTableJoinColumn) {
 		this. = rightTableJoinColumn;
 	private List<RowunmatchedRows = new ArrayList<Row>();
 	public void run(DataContext dc) {
 		DataSet ds;
 		Schema leftSchema = .getSchema();
 		Schema rightSchema = .getSchema();
 		if (leftSchema == rightSchema || leftSchema.equals(rightSchema)) {
 			FromItem joinFromItem = new FromItem(.new FromItem(), new FromItem(),
 					new SelectItem[] { new SelectItem() }, new SelectItem[] { new SelectItem(
 			Query q = new Query().select(.getColumns()).select(.getColumns()).from(joinFromItem);
 			ds = dc.executeQuery(q);
 		} else {
 			FilterItem[] onConditions = new FilterItem[] { new FilterItem(new SelectItem(),
 			ds = MetaModelHelper.getLeftJoin(ds1ds2onConditions);
		while ( {
			Row row = ds.getRow();
			if (row.getValue() == null) {
New to GrepCode? Check out our FAQ X