org.hibernate.sql.ConditionFragment Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of beangle-hibernate-core Show documentation
Show all versions of beangle-hibernate-core Show documentation
Hibernate Orm Core Shade,Support Scala Collection
/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or .
*/
package org.hibernate.sql;
import org.hibernate.internal.util.collections.ArrayHelper;
/**
* @author Gavin King
*/
public class ConditionFragment {
private String tableAlias;
private String[] lhs;
private String[] rhs;
private String op = "=";
/**
* Sets the op.
* @param op The op to set
*/
public ConditionFragment setOp(String op) {
this.op = op;
return this;
}
/**
* Sets the tableAlias.
* @param tableAlias The tableAlias to set
*/
public ConditionFragment setTableAlias(String tableAlias) {
this.tableAlias = tableAlias;
return this;
}
public ConditionFragment setCondition(String[] lhs, String[] rhs) {
this.lhs = lhs;
this.rhs = rhs;
return this;
}
public ConditionFragment setCondition(String[] lhs, String rhs) {
this.lhs = lhs;
this.rhs = ArrayHelper.fillArray(rhs, lhs.length);
return this;
}
public String toFragmentString() {
StringBuilder buf = new StringBuilder( lhs.length * 10 );
for ( int i=0; i
© 2015 - 2024 Weber Informatics LLC | Privacy Policy