FileDocCategorySizeDatePackage
ConditionFragment.javaAPI DocHibernate 3.2.51225Tue Aug 10 00:06:14 BST 2004org.hibernate.sql

ConditionFragment

public class ConditionFragment extends Object
author
Gavin King

Fields Summary
private String
tableAlias
private String[]
lhs
private String[]
rhs
private String
op
Constructors Summary
Methods Summary
public org.hibernate.sql.ConditionFragmentsetCondition(java.lang.String[] lhs, java.lang.String[] rhs)

		this.lhs = lhs;
		this.rhs = rhs;
		return this;
	
public org.hibernate.sql.ConditionFragmentsetCondition(java.lang.String[] lhs, java.lang.String rhs)

		this.lhs = lhs;
		this.rhs = ArrayHelper.fillArray(rhs, lhs.length);
		return this;
	
public org.hibernate.sql.ConditionFragmentsetOp(java.lang.String op)
Sets the op.

param
op The op to set


	         	 
	    
		this.op = op;
		return this;
	
public org.hibernate.sql.ConditionFragmentsetTableAlias(java.lang.String tableAlias)
Sets the tableAlias.

param
tableAlias The tableAlias to set

		this.tableAlias = tableAlias;
		return this;
	
public java.lang.StringtoFragmentString()

		StringBuffer buf = new StringBuffer( lhs.length * 10 );
		for ( int i=0; i<lhs.length; i++ ) {
			buf.append(tableAlias)
				.append('.")
				.append( lhs[i] )
				.append(op)
				.append( rhs[i] );
			if (i<lhs.length-1) buf.append(" and ");
		}
		return buf.toString();