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

com.xdev.jadoth.sqlengine.dbms.DbmsDMLAssembler Maven / Gradle / Ivy

There is a newer version: 6.0.2
Show newest version

package com.xdev.jadoth.sqlengine.dbms;

/*-
 * #%L
 * XDEV Application Framework
 * %%
 * Copyright (C) 2003 - 2020 XDEV Software
 * %%
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Lesser Public License for more details.
 * 
 * You should have received a copy of the GNU General Lesser Public
 * License along with this program.  If not, see
 * .
 * #L%
 */


import java.text.DateFormat;

import com.xdev.jadoth.sqlengine.internal.DoubleQuotedExpression;
import com.xdev.jadoth.sqlengine.internal.QuotedExpression;
import com.xdev.jadoth.sqlengine.internal.SqlClause;
import com.xdev.jadoth.sqlengine.internal.SqlColumn;
import com.xdev.jadoth.sqlengine.internal.SqlExpression;
import com.xdev.jadoth.sqlengine.internal.SqlTimestamp;
import com.xdev.jadoth.sqlengine.internal.interfaces.SelectItem;
import com.xdev.jadoth.sqlengine.internal.interfaces.TableExpression;
import com.xdev.jadoth.sqlengine.internal.tables.SqlTableIdentity;
import com.xdev.jadoth.sqlengine.types.Query;



/**
 * The Interface DbmsDMLAssembler.
 * 
 * @param  the generic type
 */
public interface DbmsDMLAssembler>
{
	/**
	 * Assemble query.
	 * 
	 * @param query the query
	 * @param sb the sb
	 * @param indentLevel the indent level
	 * @param flags the flags
	 */
	public void assembleQuery(Query query, StringBuilder sb, int indentLevel, int flags);

	
	public StringBuilder assembleSqlClause(
		SqlClause sqlClause, StringBuilder sb, int indentLevel, int flags
	);
	
	// (10.02.2010)TODO MERGE (and maybe "simpleMERGE" like in H2)

	/* (16.02.2010 TM)TODO: Refactor to use for every expression, not only for selectItem
	 * urgent, because "AliasedExpression" wraps a SelectItems to a SqlExpression and bypassing this method.
	 */
	/**
	 * Assemble select item.
	 * 
	 * @param selectItem the select item
	 * @param sb the sb
	 * @param indentLevel the indent level
	 * @param flags the flags
	 */
	public void assembleSelectItem(SelectItem selectItem, StringBuilder sb, int indentLevel, int flags);

	/**
	 * Assemble expression.
	 * 
	 * @param expression the expression
	 * @param sb the sb
	 * @param indentLevel the indent level
	 * @param flags the flags
	 */
	public void assembleExpression(SqlExpression expression, StringBuilder sb, int indentLevel, int flags);

	
	/**
	 * Assemble quoted expression.
	 * 
	 * @param expression the expression
	 * @param sb the sb
	 * @param indentLevel the indent level
	 * @param flags the flags
	 * @return the string builder
	 */
	public StringBuilder assembleQuotedExpression(
		QuotedExpression expression, StringBuilder sb, int indentLevel, int flags
	);

	/**
	 * Assemble double quoted expression.
	 * 
	 * @param expression the expression
	 * @param sb the sb
	 * @param indentLevel the indent level
	 * @param flags the flags
	 * @return the string builder
	 */
	public StringBuilder assembleDoubleQuotedExpression(
		DoubleQuotedExpression expression, StringBuilder sb, int indentLevel, int flags
	);
	
	public StringBuilder assembleColumnQualifier(SqlColumn column, StringBuilder sb, int flags);
	
	public StringBuilder assembleColumn(SqlColumn column, StringBuilder sb, int indentLevel, int flags);
	
	public StringBuilder assembleDelimitedIdentifier(String identifier, StringBuilder sb, int flags);
	
	public StringBuilder assembleStringValue(String s, StringBuilder sb, int indentLevel, int flags);
	
	public StringBuilder assembleObject(Object object, StringBuilder sb, int indentLevel, int flags);
	
	public StringBuilder assembleTableExpression(
		TableExpression tableExpression, StringBuilder sb, int indentLevel, int flags
	);
	
	public StringBuilder assembleTableIdentifier(
		SqlTableIdentity table, StringBuilder sb, int indentLevel, int flags
	);
	
	
	public DateFormat getDateFormatDATE();
	public DateFormat getDateFormatTIME();
	public DateFormat getDateFormatTIMESTAMP();
	
	public StringBuilder assembleDateTimeExpression(SqlTimestamp dateTimeExpression, StringBuilder sb);

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy