#695 - ENH: Add @DbArray for storing scalar types (UUID, Long, String) to Postgres ARRAY type

This commit is contained in:
Robin Bygrave committed 2016-05-09 22:38:51 +12:00
1 parent 2bb39b02d0
commit b197d8a637
53 files changed
+1102 -229

No files matched your search

@@ -335,7 +335,7 @@ public class CQuery<T> implements DbReadContext, CancelableQuery {
pstmt.setFetchSize(query.getBufferFetchSizeHint());
}
DataBind dataBind = queryPlan.bindEncryptedProperties(pstmt);
DataBind dataBind = queryPlan.bindEncryptedProperties(pstmt, conn);
bindLog = predicates.bind(dataBind);
// executeQuery
@@ -105,7 +105,7 @@ public class CQueryDelete {
pstmt.setQueryTimeout(query.getTimeout());
}
bindLog = predicates.bind(pstmt);
bindLog = predicates.bind(pstmt, conn);
rowCount = pstmt.executeUpdate();
long exeNano = System.nanoTime() - startNano;
@@ -143,7 +143,7 @@ public class CQueryFetchIds {
pstmt.setQueryTimeout(query.getTimeout());
}
bindLog = predicates.bind(pstmt);
bindLog = predicates.bind(pstmt, conn);
ResultSet rset = pstmt.executeQuery();
dataReader = new RsetDataReader(request.getDataTimeZone(), rset);
@@ -15,6 +15,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.security.MessageDigest;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
@@ -139,8 +140,8 @@ public class CQueryPlan {
/**
* Bind keys for encrypted properties if necessary returning the DataBind.
*/
public DataBind bindEncryptedProperties(PreparedStatement stmt) throws SQLException {
DataBind dataBind = new DataBind(dataTimeZone, stmt);
public DataBind bindEncryptedProperties(PreparedStatement stmt, Connection conn) throws SQLException {
DataBind dataBind = new DataBind(dataTimeZone, stmt, conn);
if (encryptedProps != null) {
for (int i = 0; i < encryptedProps.length; i++) {
String key = encryptedProps[i].getEncryptKey().getStringValue();
@@ -17,6 +17,7 @@ import com.avaje.ebeaninternal.server.expression.DefaultExpressionRequest;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Timestamp;
@@ -126,8 +127,8 @@ public class CQueryPredicates {
this.idValue = query.getId();
}
public String bind(PreparedStatement stmt) throws SQLException {
return bind(binder.dataBind(stmt));
public String bind(PreparedStatement stmt, Connection connection) throws SQLException {
return bind(binder.dataBind(stmt, connection));
}
public String bind(DataBind dataBind) throws SQLException {
@@ -116,7 +116,7 @@ public class CQueryRowCount {
pstmt.setQueryTimeout(query.getTimeout());
}
bindLog = predicates.bind(pstmt);
bindLog = predicates.bind(pstmt, conn);
rset = pstmt.executeQuery();
if (!rset.next()) {