All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.j256.ormlite.stmt.query.SimpleComparison Maven / Gradle / Ivy

Go to download

Lightweight Object Relational Model (ORM) for persisting objects to SQL databases.

There is a newer version: 6.1
Show newest version
package com.j256.ormlite.stmt.query;

import java.sql.SQLException;

import com.j256.ormlite.field.FieldType;

/**
 * Internal class handling a simple comparison query part where the operation is passed in.
 * 
 * @author graywatson
 */
public class SimpleComparison extends BaseComparison {

	public final static String EQUAL_TO_OPERATION = "=";
	public final static String GREATER_THAN_OPERATION = ">";
	public final static String GREATER_THAN_EQUAL_TO_OPERATION = ">=";
	public final static String LESS_THAN_OPERATION = "<";
	public final static String LESS_THAN_EQUAL_TO_OPERATION = "<=";
	public final static String LIKE_OPERATION = "LIKE";
	public final static String NOT_EQUAL_TO_OPERATION = "<>";

	private final String operation;

	public SimpleComparison(String columnName, FieldType fieldType, Object value, String operation) throws SQLException {
		super(columnName, fieldType, value, true);
		this.operation = operation;
	}

	@Override
	public void appendOperation(StringBuilder sb) {
		sb.append(operation);
		sb.append(' ');
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy