Fix for #97 - ENH: (406) Add support for Postgres Serial type

This commit is contained in:
Rob Bygrave committed 2014-06-13 23:48:45 +12:00
1 parent 974284bf8a
commit 7d83e3f49e
8 files changed
+128 -25

No files matched your search

@@ -237,8 +237,7 @@ public abstract class DmlHandler implements PersistHandler, BindableRequest {
/**
* Check with useGeneratedKeys to get appropriate PreparedStatement.
*/
protected PreparedStatement getPstmt(SpiTransaction t, String sql, boolean genKeys)
throws SQLException {
protected PreparedStatement getPstmt(SpiTransaction t, String sql, boolean genKeys) throws SQLException {
Connection conn = t.getInternalConnection();
if (genKeys) {
@@ -4,7 +4,6 @@ import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.List;
import javax.persistence.OptimisticLockException;
@@ -115,7 +114,7 @@ public class InsertHandler extends DmlHandler {
protected PreparedStatement getPstmt(SpiTransaction t, String sql, boolean useGeneratedKeys) throws SQLException {
Connection conn = t.getInternalConnection();
if (useGeneratedKeys) {
return conn.prepareStatement(sql, Statement.RETURN_GENERATED_KEYS);
return conn.prepareStatement(sql, meta.getIdentityDbColumns());
} else {
return conn.prepareStatement(sql);