Loading src/main/java/it/inaf/oats/vospace/persistence/NodeDAO.java +4 −5 Original line number Diff line number Diff line Loading @@ -63,9 +63,9 @@ public class NodeDAO { StringBuilder sb = new StringBuilder(); sb.append("INSERT INTO node"); sb.append(" (name, busy_state, owner_id, creator_id, group_read, group_write,"); sb.append(" (name, busy_state, creator_id, group_read, group_write,"); sb.append(" is_public, parent_path, parent_relative_path, type, accept_views, provide_views)"); sb.append(" VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); sb.append(" VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); jdbcTemplate.update(conn -> { PreparedStatement ps = conn.prepareStatement(sb.toString()); Loading @@ -73,7 +73,6 @@ public class NodeDAO { ps.setString(++i, NodeUtils.getNodeName(myNode)); ps.setBoolean(++i, NodeUtils.getIsBusy(myNode)); ps.setString(++i, NodeProperties.getStandardNodePropertyByName(myNode, "creator")); ps.setString(++i, NodeProperties.getStandardNodePropertyByName(myNode, "creator")); ps.setArray(++i, fromPropertyToArray(ps, NodeProperties.getStandardNodePropertyByName(myNode, "groupread"))); ps.setArray(++i, fromPropertyToArray(ps, NodeProperties.getStandardNodePropertyByName(myNode, "groupwrite"))); ps.setBoolean(++i, Boolean.valueOf(NodeProperties.getStandardNodePropertyByName(myNode, "publicread"))); Loading Loading @@ -240,7 +239,7 @@ public class NodeDAO { String insertSql = "INSERT INTO deleted_node " + "(node_id, parent_path, parent_relative_path, " + "name, os_name, tstamp_wrapper_dir, type, location_id, format, " + "async_trans, busy_state, owner_id, creator_id, group_read, " + "async_trans, busy_state, creator_id, group_read, " + "group_write, is_public, delta, content_type, content_encoding, " + "content_length, content_md5, created_on, last_modified, " + "accept_views, provide_views, protocols, sticky)\n"; Loading @@ -253,7 +252,7 @@ public class NodeDAO { + "OR os.vos_path = ?) RETURNING\n" + "n.node_id, parent_path, parent_relative_path, " + "name, os_name, tstamp_wrapper_dir, type, location_id, format, " + "async_trans, busy_state, owner_id, creator_id, group_read, " + "async_trans, busy_state, creator_id, group_read, " + "group_write, is_public, delta, content_type, content_encoding, " + "content_length, content_md5, created_on, last_modified, " + "accept_views, provide_views, protocols, sticky\n"; Loading src/test/resources/test-data.sql +9 −9 Original line number Diff line number Diff line DELETE FROM node; ALTER SEQUENCE node_node_id_seq RESTART WITH 1; INSERT INTO node (parent_path, parent_relative_path, name, type, owner_id, creator_id, location_id, is_public) VALUES (NULL, NULL, '', 'container', '0', '0', 1, true); INSERT INTO node (parent_path, parent_relative_path, name, type, creator_id, location_id, is_public) VALUES (NULL, NULL, '', 'container', '0', 1, true); INSERT INTO node (parent_path, parent_relative_path, name, type, owner_id, creator_id, group_read, group_write, location_id) VALUES ('', NULL, 'test1', 'container', 'user1', 'user1', '{"group1","group2"}','{"group2"}', 1); -- /test1 INSERT INTO node (parent_path, parent_relative_path, name, type, owner_id, creator_id, location_id) VALUES ('2', '', 'f1', 'container', 'user1', 'user1', 1); -- /test1/f1 (rel: /f1) INSERT INTO node (parent_path, parent_relative_path, name, os_name, type, owner_id, creator_id, location_id) VALUES ('2.3', '3', 'f2_renamed', 'f2', 'container', 'user1', 'user1', 1); -- /test1/f1/f2_renamed (rel: /f1/f2) INSERT INTO node (parent_path, parent_relative_path, name, type, owner_id, creator_id, location_id) VALUES ('2.3.4', '3.4', 'f3', 'data', 'user1', 'user1', 1); -- /test1/f1/f2_renamed/f3 (rel: /f1/f2/f3) INSERT INTO node (parent_path, parent_relative_path, name, type, creator_id, group_read, group_write, location_id) VALUES ('', NULL, 'test1', 'container', 'user1', '{"group1","group2"}','{"group2"}', 1); -- /test1 INSERT INTO node (parent_path, parent_relative_path, name, type, creator_id, location_id) VALUES ('2', '', 'f1', 'container', 'user1', 1); -- /test1/f1 (rel: /f1) INSERT INTO node (parent_path, parent_relative_path, name, os_name, type, creator_id, location_id) VALUES ('2.3', '3', 'f2_renamed', 'f2', 'container', 'user1', 1); -- /test1/f1/f2_renamed (rel: /f1/f2) INSERT INTO node (parent_path, parent_relative_path, name, type, creator_id, location_id) VALUES ('2.3.4', '3.4', 'f3', 'data', 'user1', 1); -- /test1/f1/f2_renamed/f3 (rel: /f1/f2/f3) INSERT INTO node (parent_path, parent_relative_path, name, type, owner_id, creator_id, is_public, location_id) VALUES ('', NULL, 'test2', 'container', 'user2', 'user2', true, 1); -- /test2 INSERT INTO node (parent_path, parent_relative_path, name, type, owner_id, creator_id, is_public, location_id) VALUES ('6', '', 'f4', 'container', 'user2', 'user2', true, 1); -- /test2/f4 (rel: /f4) INSERT INTO node (parent_path, parent_relative_path, name, type, owner_id, creator_id, is_public, location_id) VALUES ('6', '', 'f5', 'container', 'user2', 'user2', true, 1); -- /test2/f5 (rel: /f5) INSERT INTO node (parent_path, parent_relative_path, name, type, creator_id, is_public, location_id) VALUES ('', NULL, 'test2', 'container', 'user2', true, 1); -- /test2 INSERT INTO node (parent_path, parent_relative_path, name, type, creator_id, is_public, location_id) VALUES ('6', '', 'f4', 'container', 'user2', true, 1); -- /test2/f4 (rel: /f4) INSERT INTO node (parent_path, parent_relative_path, name, type, creator_id, is_public, location_id) VALUES ('6', '', 'f5', 'container', 'user2', true, 1); -- /test2/f5 (rel: /f5) DELETE FROM job; Loading Loading
src/main/java/it/inaf/oats/vospace/persistence/NodeDAO.java +4 −5 Original line number Diff line number Diff line Loading @@ -63,9 +63,9 @@ public class NodeDAO { StringBuilder sb = new StringBuilder(); sb.append("INSERT INTO node"); sb.append(" (name, busy_state, owner_id, creator_id, group_read, group_write,"); sb.append(" (name, busy_state, creator_id, group_read, group_write,"); sb.append(" is_public, parent_path, parent_relative_path, type, accept_views, provide_views)"); sb.append(" VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); sb.append(" VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"); jdbcTemplate.update(conn -> { PreparedStatement ps = conn.prepareStatement(sb.toString()); Loading @@ -73,7 +73,6 @@ public class NodeDAO { ps.setString(++i, NodeUtils.getNodeName(myNode)); ps.setBoolean(++i, NodeUtils.getIsBusy(myNode)); ps.setString(++i, NodeProperties.getStandardNodePropertyByName(myNode, "creator")); ps.setString(++i, NodeProperties.getStandardNodePropertyByName(myNode, "creator")); ps.setArray(++i, fromPropertyToArray(ps, NodeProperties.getStandardNodePropertyByName(myNode, "groupread"))); ps.setArray(++i, fromPropertyToArray(ps, NodeProperties.getStandardNodePropertyByName(myNode, "groupwrite"))); ps.setBoolean(++i, Boolean.valueOf(NodeProperties.getStandardNodePropertyByName(myNode, "publicread"))); Loading Loading @@ -240,7 +239,7 @@ public class NodeDAO { String insertSql = "INSERT INTO deleted_node " + "(node_id, parent_path, parent_relative_path, " + "name, os_name, tstamp_wrapper_dir, type, location_id, format, " + "async_trans, busy_state, owner_id, creator_id, group_read, " + "async_trans, busy_state, creator_id, group_read, " + "group_write, is_public, delta, content_type, content_encoding, " + "content_length, content_md5, created_on, last_modified, " + "accept_views, provide_views, protocols, sticky)\n"; Loading @@ -253,7 +252,7 @@ public class NodeDAO { + "OR os.vos_path = ?) RETURNING\n" + "n.node_id, parent_path, parent_relative_path, " + "name, os_name, tstamp_wrapper_dir, type, location_id, format, " + "async_trans, busy_state, owner_id, creator_id, group_read, " + "async_trans, busy_state, creator_id, group_read, " + "group_write, is_public, delta, content_type, content_encoding, " + "content_length, content_md5, created_on, last_modified, " + "accept_views, provide_views, protocols, sticky\n"; Loading
src/test/resources/test-data.sql +9 −9 Original line number Diff line number Diff line DELETE FROM node; ALTER SEQUENCE node_node_id_seq RESTART WITH 1; INSERT INTO node (parent_path, parent_relative_path, name, type, owner_id, creator_id, location_id, is_public) VALUES (NULL, NULL, '', 'container', '0', '0', 1, true); INSERT INTO node (parent_path, parent_relative_path, name, type, creator_id, location_id, is_public) VALUES (NULL, NULL, '', 'container', '0', 1, true); INSERT INTO node (parent_path, parent_relative_path, name, type, owner_id, creator_id, group_read, group_write, location_id) VALUES ('', NULL, 'test1', 'container', 'user1', 'user1', '{"group1","group2"}','{"group2"}', 1); -- /test1 INSERT INTO node (parent_path, parent_relative_path, name, type, owner_id, creator_id, location_id) VALUES ('2', '', 'f1', 'container', 'user1', 'user1', 1); -- /test1/f1 (rel: /f1) INSERT INTO node (parent_path, parent_relative_path, name, os_name, type, owner_id, creator_id, location_id) VALUES ('2.3', '3', 'f2_renamed', 'f2', 'container', 'user1', 'user1', 1); -- /test1/f1/f2_renamed (rel: /f1/f2) INSERT INTO node (parent_path, parent_relative_path, name, type, owner_id, creator_id, location_id) VALUES ('2.3.4', '3.4', 'f3', 'data', 'user1', 'user1', 1); -- /test1/f1/f2_renamed/f3 (rel: /f1/f2/f3) INSERT INTO node (parent_path, parent_relative_path, name, type, creator_id, group_read, group_write, location_id) VALUES ('', NULL, 'test1', 'container', 'user1', '{"group1","group2"}','{"group2"}', 1); -- /test1 INSERT INTO node (parent_path, parent_relative_path, name, type, creator_id, location_id) VALUES ('2', '', 'f1', 'container', 'user1', 1); -- /test1/f1 (rel: /f1) INSERT INTO node (parent_path, parent_relative_path, name, os_name, type, creator_id, location_id) VALUES ('2.3', '3', 'f2_renamed', 'f2', 'container', 'user1', 1); -- /test1/f1/f2_renamed (rel: /f1/f2) INSERT INTO node (parent_path, parent_relative_path, name, type, creator_id, location_id) VALUES ('2.3.4', '3.4', 'f3', 'data', 'user1', 1); -- /test1/f1/f2_renamed/f3 (rel: /f1/f2/f3) INSERT INTO node (parent_path, parent_relative_path, name, type, owner_id, creator_id, is_public, location_id) VALUES ('', NULL, 'test2', 'container', 'user2', 'user2', true, 1); -- /test2 INSERT INTO node (parent_path, parent_relative_path, name, type, owner_id, creator_id, is_public, location_id) VALUES ('6', '', 'f4', 'container', 'user2', 'user2', true, 1); -- /test2/f4 (rel: /f4) INSERT INTO node (parent_path, parent_relative_path, name, type, owner_id, creator_id, is_public, location_id) VALUES ('6', '', 'f5', 'container', 'user2', 'user2', true, 1); -- /test2/f5 (rel: /f5) INSERT INTO node (parent_path, parent_relative_path, name, type, creator_id, is_public, location_id) VALUES ('', NULL, 'test2', 'container', 'user2', true, 1); -- /test2 INSERT INTO node (parent_path, parent_relative_path, name, type, creator_id, is_public, location_id) VALUES ('6', '', 'f4', 'container', 'user2', true, 1); -- /test2/f4 (rel: /f4) INSERT INTO node (parent_path, parent_relative_path, name, type, creator_id, is_public, location_id) VALUES ('6', '', 'f5', 'container', 'user2', true, 1); -- /test2/f5 (rel: /f5) DELETE FROM job; Loading