Skip to content

Commit

Permalink
Update PlainPostgresParameterBatch.java
Browse files Browse the repository at this point in the history
compositeId added for reference types

Signed-off-by: Berkant Karduman <[email protected]>
  • Loading branch information
berkant-k authored Nov 15, 2023
1 parent 8429bf7 commit d219d57
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -516,19 +516,20 @@ public void addSecurity(long logicalResourceId, long commonTokenValueId) throws
* @param refLogicalResourceId
* @param refVersionId
*/
public void addReference(long logicalResourceId, int parameterNameId, long refLogicalResourceId, Integer refVersionId) throws SQLException {
public void addReference(long logicalResourceId, int parameterNameId, long refLogicalResourceId, Integer refVersionId,Integer compositeId) throws SQLException {
logger.fine(() -> "Adding reference: parameterNameId:" + parameterNameId + " refLogicalResourceId:" + refLogicalResourceId + " refVersionId:" + refVersionId);
if (refs == null) {
final String tablePrefix = resourceType.toLowerCase();
final String insertString = "INSERT INTO " + tablePrefix + "_ref_values (parameter_name_id, logical_resource_id, ref_logical_resource_id, ref_version_id) VALUES (?,?,?,?)";
final String insertString = "INSERT INTO " + tablePrefix + "_ref_values (parameter_name_id, logical_resource_id, ref_logical_resource_id, ref_version_id,composite_id) VALUES (?,?,?,?,?)";
refs = connection.prepareStatement(insertString);
}
PreparedStatementHelper psh = new PreparedStatementHelper(refs);
psh.setInt(parameterNameId)
.setLong(logicalResourceId)
.setLong(refLogicalResourceId)
.setInt(refVersionId)
.setInt(compositeId)
.addBatch();
refCount++;
}
}
}

0 comments on commit d219d57

Please sign in to comment.