From 88d28b627c5e365584a6d513f0bdc84d9edffb29 Mon Sep 17 00:00:00 2001 From: Sandeep Ravindra Date: Thu, 4 Jan 2018 16:47:22 +0530 Subject: Adding default sequence select statement for PostgreSQL to pickup native sequences --- .../com/amazon/carbonado/repo/jdbc/PostgresqlSupportStrategy.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main/java') diff --git a/src/main/java/com/amazon/carbonado/repo/jdbc/PostgresqlSupportStrategy.java b/src/main/java/com/amazon/carbonado/repo/jdbc/PostgresqlSupportStrategy.java index fffa5cf..43623be 100644 --- a/src/main/java/com/amazon/carbonado/repo/jdbc/PostgresqlSupportStrategy.java +++ b/src/main/java/com/amazon/carbonado/repo/jdbc/PostgresqlSupportStrategy.java @@ -25,11 +25,16 @@ package com.amazon.carbonado.repo.jdbc; * @since 1.2 */ class PostgresqlSupportStrategy extends JDBCSupportStrategy { + private static final String TRUNCATE_STATEMENT = "TRUNCATE TABLE %s"; + private static final String DEFAULT_SEQUENCE_SELECT_STATEMENT = "SELECT NEXTVAL('%s')"; + protected PostgresqlSupportStrategy(JDBCRepository repo) { super(repo); + setSequenceSelectStatement(DEFAULT_SEQUENCE_SELECT_STATEMENT); + setTruncateTableStatement(TRUNCATE_STATEMENT); } -- cgit v1.2.3