mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUAC-1103: Explicitly cast strings to integers.
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
SELECT connection_id
|
||||
FROM guacamole_connection
|
||||
WHERE
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}</if>
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}::integer</if>
|
||||
<if test="parentIdentifier == null">parent_id IS NULL</if>
|
||||
</select>
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
FROM guacamole_connection
|
||||
JOIN guacamole_connection_permission ON guacamole_connection_permission.connection_id = guacamole_connection.connection_id
|
||||
WHERE
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}</if>
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}::integer</if>
|
||||
<if test="parentIdentifier == null">parent_id IS NULL</if>
|
||||
AND user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = 'READ'
|
||||
@@ -82,7 +82,7 @@
|
||||
WHERE connection_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=INTEGER}
|
||||
#{identifier,jdbcType=INTEGER}::integer
|
||||
</foreach>
|
||||
|
||||
</select>
|
||||
@@ -100,7 +100,7 @@
|
||||
WHERE guacamole_connection.connection_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=INTEGER}
|
||||
#{identifier,jdbcType=INTEGER}::integer
|
||||
</foreach>
|
||||
AND user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = 'READ'
|
||||
@@ -117,7 +117,7 @@
|
||||
protocol
|
||||
FROM guacamole_connection
|
||||
WHERE
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}</if>
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}::integer</if>
|
||||
<if test="parentIdentifier == null">parent_id IS NULL</if>
|
||||
AND connection_name = #{name,jdbcType=VARCHAR}
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
<!-- Delete single connection by identifier -->
|
||||
<delete id="delete">
|
||||
DELETE FROM guacamole_connection
|
||||
WHERE connection_id = #{identifier,jdbcType=INTEGER}
|
||||
WHERE connection_id = #{identifier,jdbcType=INTEGER}::integer
|
||||
</delete>
|
||||
|
||||
<!-- Insert single connection -->
|
||||
@@ -140,7 +140,7 @@
|
||||
)
|
||||
VALUES (
|
||||
#{object.name,jdbcType=VARCHAR},
|
||||
#{object.parentIdentifier,jdbcType=INTEGER},
|
||||
#{object.parentIdentifier,jdbcType=INTEGER}::integer,
|
||||
#{object.protocol,jdbcType=VARCHAR}
|
||||
)
|
||||
|
||||
@@ -150,9 +150,9 @@
|
||||
<update id="update" parameterType="org.glyptodon.guacamole.auth.jdbc.connection.ConnectionModel">
|
||||
UPDATE guacamole_connection
|
||||
SET connection_name = #{object.name,jdbcType=VARCHAR},
|
||||
parent_id = #{object.parentIdentifier,jdbcType=INTEGER},
|
||||
parent_id = #{object.parentIdentifier,jdbcType=INTEGER}::integer,
|
||||
protocol = #{object.protocol,jdbcType=VARCHAR}
|
||||
WHERE connection_id = #{object.objectID,jdbcType=INTEGER}
|
||||
WHERE connection_id = #{object.objectID,jdbcType=INTEGER}::integer
|
||||
</update>
|
||||
|
||||
</mapper>
|
@@ -47,7 +47,7 @@
|
||||
FROM guacamole_connection_history
|
||||
JOIN guacamole_user ON guacamole_connection_history.user_id = guacamole_user.user_id
|
||||
WHERE
|
||||
connection_id = #{identifier,jdbcType=INTEGER}
|
||||
connection_id = #{identifier,jdbcType=INTEGER}::integer
|
||||
ORDER BY
|
||||
start_date DESC,
|
||||
end_date DESC
|
||||
@@ -64,7 +64,7 @@
|
||||
end_date
|
||||
)
|
||||
VALUES (
|
||||
#{record.connectionIdentifier,jdbcType=INTEGER},
|
||||
#{record.connectionIdentifier,jdbcType=INTEGER}::integer,
|
||||
#{record.userID,jdbcType=INTEGER},
|
||||
#{record.startDate,jdbcType=TIMESTAMP},
|
||||
#{record.endDate,jdbcType=TIMESTAMP}
|
||||
|
@@ -41,13 +41,13 @@
|
||||
parameter_value
|
||||
FROM guacamole_connection_parameter
|
||||
WHERE
|
||||
connection_id = #{identifier,jdbcType=INTEGER}
|
||||
connection_id = #{identifier,jdbcType=INTEGER}::integer
|
||||
</select>
|
||||
|
||||
<!-- Delete all parameters of a given connection -->
|
||||
<delete id="delete">
|
||||
DELETE FROM guacamole_connection_parameter
|
||||
WHERE connection_id = #{identifier,jdbcType=INTEGER}
|
||||
WHERE connection_id = #{identifier,jdbcType=INTEGER}::integer
|
||||
</delete>
|
||||
|
||||
<!-- Insert all given parameters -->
|
||||
@@ -60,7 +60,7 @@
|
||||
)
|
||||
VALUES
|
||||
<foreach collection="parameters" item="parameter" separator=",">
|
||||
(#{parameter.connectionIdentifier,jdbcType=INTEGER},
|
||||
(#{parameter.connectionIdentifier,jdbcType=INTEGER}::integer,
|
||||
#{parameter.name,jdbcType=VARCHAR},
|
||||
#{parameter.value,jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
|
@@ -55,7 +55,7 @@
|
||||
SELECT connection_group_id
|
||||
FROM guacamole_connection_group
|
||||
WHERE
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}</if>
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}::integer</if>
|
||||
<if test="parentIdentifier == null">parent_id IS NULL</if>
|
||||
</select>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
FROM guacamole_connection_group
|
||||
JOIN guacamole_connection_group_permission ON guacamole_connection_group_permission.connection_group_id = guacamole_connection_group.connection_group_id
|
||||
WHERE
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}</if>
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}::integer</if>
|
||||
<if test="parentIdentifier == null">parent_id IS NULL</if>
|
||||
AND user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = 'READ'
|
||||
@@ -101,7 +101,7 @@
|
||||
WHERE guacamole_connection_group.connection_group_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=INTEGER}
|
||||
#{identifier,jdbcType=INTEGER}::integer
|
||||
</foreach>
|
||||
AND user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = 'READ'
|
||||
@@ -118,7 +118,7 @@
|
||||
type
|
||||
FROM guacamole_connection_group
|
||||
WHERE
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}</if>
|
||||
<if test="parentIdentifier != null">parent_id = #{parentIdentifier,jdbcType=INTEGER}::integer</if>
|
||||
<if test="parentIdentifier == null">parent_id IS NULL</if>
|
||||
AND connection_group_name = #{name,jdbcType=VARCHAR}
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
<!-- Delete single connection group by identifier -->
|
||||
<delete id="delete">
|
||||
DELETE FROM guacamole_connection_group
|
||||
WHERE connection_group_id = #{identifier,jdbcType=INTEGER}
|
||||
WHERE connection_group_id = #{identifier,jdbcType=INTEGER}::integer
|
||||
</delete>
|
||||
|
||||
<!-- Insert single connection -->
|
||||
@@ -141,7 +141,7 @@
|
||||
)
|
||||
VALUES (
|
||||
#{object.name,jdbcType=VARCHAR},
|
||||
#{object.parentIdentifier,jdbcType=INTEGER},
|
||||
#{object.parentIdentifier,jdbcType=INTEGER}::integer,
|
||||
#{object.type,jdbcType=VARCHAR}
|
||||
)
|
||||
|
||||
@@ -151,9 +151,9 @@
|
||||
<update id="update" parameterType="org.glyptodon.guacamole.auth.jdbc.connectiongroup.ConnectionGroupModel">
|
||||
UPDATE guacamole_connection_group
|
||||
SET connection_group_name = #{object.name,jdbcType=VARCHAR},
|
||||
parent_id = #{object.parentIdentifier,jdbcType=INTEGER},
|
||||
parent_id = #{object.parentIdentifier,jdbcType=INTEGER}::integer,
|
||||
type = #{object.type,jdbcType=VARCHAR}
|
||||
WHERE connection_group_id = #{object.objectID,jdbcType=INTEGER}
|
||||
WHERE connection_group_id = #{object.objectID,jdbcType=INTEGER}::integer
|
||||
</update>
|
||||
|
||||
</mapper>
|
@@ -62,7 +62,7 @@
|
||||
WHERE
|
||||
guacamole_connection_group_permission.user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = #{type,jdbcType=VARCHAR}::guacamole_object_permission_type
|
||||
AND connection_group_id = #{identifier,jdbcType=INTEGER}
|
||||
AND connection_group_id = #{identifier,jdbcType=INTEGER}::integer
|
||||
|
||||
</select>
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
AND connection_group_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=INTEGER}
|
||||
#{identifier,jdbcType=INTEGER}::integer
|
||||
</foreach>
|
||||
AND permission IN
|
||||
<foreach collection="permissions" item="permission"
|
||||
@@ -112,7 +112,7 @@
|
||||
<foreach collection="permissions" item="permission" separator=",">
|
||||
(#{permission.userID,jdbcType=INTEGER},
|
||||
#{permission.type,jdbcType=VARCHAR}::guacamole_object_permission_type,
|
||||
#{permission.objectIdentifier,jdbcType=INTEGER})
|
||||
#{permission.objectIdentifier,jdbcType=INTEGER}::integer)
|
||||
</foreach>
|
||||
|
||||
</insert>
|
||||
|
@@ -62,7 +62,7 @@
|
||||
WHERE
|
||||
guacamole_connection_permission.user_id = #{user.objectID,jdbcType=INTEGER}
|
||||
AND permission = #{type,jdbcType=VARCHAR}::guacamole_object_permission_type
|
||||
AND connection_id = #{identifier,jdbcType=INTEGER}
|
||||
AND connection_id = #{identifier,jdbcType=INTEGER}::integer
|
||||
|
||||
</select>
|
||||
|
||||
@@ -76,7 +76,7 @@
|
||||
AND connection_id IN
|
||||
<foreach collection="identifiers" item="identifier"
|
||||
open="(" separator="," close=")">
|
||||
#{identifier,jdbcType=INTEGER}
|
||||
#{identifier,jdbcType=INTEGER}::integer
|
||||
</foreach>
|
||||
AND permission IN
|
||||
<foreach collection="permissions" item="permission"
|
||||
@@ -95,7 +95,7 @@
|
||||
open="(" separator="," close=")">
|
||||
(#{permission.userID,jdbcType=INTEGER},
|
||||
#{permission.type,jdbcType=VARCHAR}::guacamole_object_permission_type,
|
||||
#{permission.objectIdentifier,jdbcType=INTEGER})
|
||||
#{permission.objectIdentifier,jdbcType=INTEGER}::integer)
|
||||
</foreach>
|
||||
|
||||
</delete>
|
||||
@@ -112,7 +112,7 @@
|
||||
<foreach collection="permissions" item="permission" separator=",">
|
||||
(#{permission.userID,jdbcType=INTEGER},
|
||||
#{permission.type,jdbcType=VARCHAR}::guacamole_object_permission_type,
|
||||
#{permission.objectIdentifier,jdbcType=INTEGER})
|
||||
#{permission.objectIdentifier,jdbcType=INTEGER}::integer)
|
||||
</foreach>
|
||||
|
||||
</insert>
|
||||
|
Reference in New Issue
Block a user