org.hibernate.sql.Insert Maven / Gradle / Ivy
The newest version!
//$Id: Insert.java 9681 2006-03-24 18:10:04Z [email protected] $
package org.hibernate.sql;
import java.util.Iterator;
import java.util.Map;
import org.apache.commons.collections.SequencedHashMap;
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 SequencedHashMap();
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