org.hibernate.sql.Insert Maven / Gradle / Ivy
                 Go to download
                
        
                    Show more of this group  Show more artifacts with this name
Show all versions of hibernate-core Show documentation
                Show all versions of hibernate-core Show documentation
The core O/RM functionality as provided by Hibernate
                
             The newest version!
        
        /*
 * 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 java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import org.hibernate.dialect.Dialect;
import org.hibernate.type.LiteralType;
/**
 * An SQL INSERT statement
 *
 * @author Gavin King
 */
public class Insert {
	private Dialect dialect;
	private String tableName;
	private String comment;
	private Map columns = new LinkedHashMap();
	public Insert(Dialect dialect) {
		this.dialect = dialect;
	}
	protected Dialect getDialect() {
		return dialect;
	}
	public Insert setComment(String comment) {
		this.comment = comment;
		return this;
	}
	public Insert addColumn(String columnName) {
		return addColumn(columnName, "?");
	}
	public Insert addColumns(String[] columnNames) {
		for ( int i=0; i     © 2015 - 2025 Weber Informatics LLC | Privacy Policy