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

de.ec.sql.OrderByTerm Maven / Gradle / Ivy

There is a newer version: 1.2
Show newest version
package de.ec.sql;

import lombok.AccessLevel;
import lombok.Getter;

@Getter(AccessLevel.PROTECTED)
public class OrderByTerm implements QueryPart {

	private final Name name;
	private final boolean ascending;

	protected OrderByTerm(final String name, final boolean ascending) {
		this(null, name, ascending);
	}

	protected OrderByTerm(final String schema, final String name, final boolean ascending) {
		this.name = new Name().schema(schema)
				.name(name);
		this.ascending = ascending;
	}

	@Override
	public String string(final QueryOptions options) {
		return name.string(options) + " " + options.cased(ascending ? "ASC" : "DESC");
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy