org.fluentjdbc.DatabaseSaveBuilderWithoutGeneratedKeys Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fluent-jdbc Show documentation
Show all versions of fluent-jdbc Show documentation
A Java library used to execute JDBC statements and build SQL
package org.fluentjdbc;
import java.sql.Connection;
import javax.annotation.Nullable;
public class DatabaseSaveBuilderWithoutGeneratedKeys extends DatabaseSaveBuilder {
public DatabaseSaveBuilderWithoutGeneratedKeys(DatabaseTableImpl table, String idField, Long id) {
super(table, idField, id);
}
@Override
@Nullable
protected Long insert(Connection connection) {
DatabaseInsertBuilder builder = table.insert();
if (idValue != null) {
builder = builder.setField(idField, idValue);
}
builder
.setFields(fields, values)
.setFields(uniqueKeyFields, uniqueKeyValues)
.execute(connection);
return idValue;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy