org.hibernate.sql.DisjunctionFragment 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;
/**
* A disjunctive string of conditions
* @author Gavin King
*/
public class DisjunctionFragment {
private StringBuilder buffer = new StringBuilder();
public DisjunctionFragment addCondition(ConditionFragment fragment) {
addCondition( fragment.toFragmentString() );
return this;
}
public DisjunctionFragment addCondition(String fragment) {
if ( buffer.length() > 0 ) {
buffer.append(" or ");
}
buffer.append( '(' )
.append( fragment )
.append( ')' );
return this;
}
public String toFragmentString() {
return buffer.toString();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy