Commit c144b440 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Improved file info query

parent 7128901f
Loading
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -40,12 +40,11 @@ public class FileDAO {
                + "content_type, content_encoding, content_length, content_md5,\n"
                + "accept_views, provide_views, l.location_type, n.path <> n.relative_path AS virtual_parent,\n"
                + "(SELECT user_name FROM users WHERE user_id = creator_id) AS username,\n"
                + "base_path, os_path\n"
                + "FROM node_path p\n"
                + "JOIN node n ON p.node_id = n.node_id\n"
                + "base_path, get_os_path(n.node_id) AS os_path\n"
                + "FROM node n\n"
                + "JOIN location l ON (n.location_id IS NOT NULL AND n.location_id = l.location_id) OR (n.location_id IS NULL AND l.location_id = ?)\n"
                + "LEFT JOIN storage s ON s.storage_id = l.storage_dest_id\n"
                + "WHERE p.vos_path = ?";
                + "WHERE n.node_id = id_from_vos_path(?)";

        FileInfo fileInfo = jdbcTemplate.query(conn -> {
            PreparedStatement ps = conn.prepareStatement(sql);