Ticket #269: Clean up MySQLUser, handle null username. Move mybatis XMLs to proper package within resources, fix SQL syntax (guacamole.TABLE, not guacamole..TABLE - likely need to fix generator).

This commit is contained in:
Michael Jumper
2013-02-25 02:07:45 -08:00
parent aab2a3c698
commit 97c2e3ceb9
9 changed files with 98 additions and 79 deletions

View File

@@ -0,0 +1,286 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionHistoryMapper" >
<resultMap id="BaseResultMap" type="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<id column="history_id" property="history_id" jdbcType="INTEGER" />
<result column="user_id" property="user_id" jdbcType="INTEGER" />
<result column="connection_id" property="connection_id" jdbcType="INTEGER" />
<result column="start_date" property="start_date" jdbcType="TIMESTAMP" />
<result column="end_date" property="end_date" jdbcType="TIMESTAMP" />
</resultMap>
<sql id="Example_Where_Clause" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<where >
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
history_id, user_id, connection_id, start_date, end_date
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistoryExample" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from guacamole.guacamole_connection_history
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select
<include refid="Base_Column_List" />
from guacamole.guacamole_connection_history
where history_id = #{history_id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
delete from guacamole.guacamole_connection_history
where history_id = #{history_id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistoryExample" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
delete from guacamole.guacamole_connection_history
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
insert into guacamole.guacamole_connection_history (history_id, user_id, connection_id,
start_date, end_date)
values (#{history_id,jdbcType=INTEGER}, #{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER},
#{start_date,jdbcType=TIMESTAMP}, #{end_date,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
insert into guacamole.guacamole_connection_history
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="history_id != null" >
history_id,
</if>
<if test="user_id != null" >
user_id,
</if>
<if test="connection_id != null" >
connection_id,
</if>
<if test="start_date != null" >
start_date,
</if>
<if test="end_date != null" >
end_date,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="history_id != null" >
#{history_id,jdbcType=INTEGER},
</if>
<if test="user_id != null" >
#{user_id,jdbcType=INTEGER},
</if>
<if test="connection_id != null" >
#{connection_id,jdbcType=INTEGER},
</if>
<if test="start_date != null" >
#{start_date,jdbcType=TIMESTAMP},
</if>
<if test="end_date != null" >
#{end_date,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistoryExample" resultType="java.lang.Integer" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select count(*) from guacamole.guacamole_connection_history
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_connection_history
<set >
<if test="record.history_id != null" >
history_id = #{record.history_id,jdbcType=INTEGER},
</if>
<if test="record.user_id != null" >
user_id = #{record.user_id,jdbcType=INTEGER},
</if>
<if test="record.connection_id != null" >
connection_id = #{record.connection_id,jdbcType=INTEGER},
</if>
<if test="record.start_date != null" >
start_date = #{record.start_date,jdbcType=TIMESTAMP},
</if>
<if test="record.end_date != null" >
end_date = #{record.end_date,jdbcType=TIMESTAMP},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_connection_history
set history_id = #{record.history_id,jdbcType=INTEGER},
user_id = #{record.user_id,jdbcType=INTEGER},
connection_id = #{record.connection_id,jdbcType=INTEGER},
start_date = #{record.start_date,jdbcType=TIMESTAMP},
end_date = #{record.end_date,jdbcType=TIMESTAMP}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_connection_history
<set >
<if test="user_id != null" >
user_id = #{user_id,jdbcType=INTEGER},
</if>
<if test="connection_id != null" >
connection_id = #{connection_id,jdbcType=INTEGER},
</if>
<if test="start_date != null" >
start_date = #{start_date,jdbcType=TIMESTAMP},
</if>
<if test="end_date != null" >
end_date = #{end_date,jdbcType=TIMESTAMP},
</if>
</set>
where history_id = #{history_id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistory" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_connection_history
set user_id = #{user_id,jdbcType=INTEGER},
connection_id = #{connection_id,jdbcType=INTEGER},
start_date = #{start_date,jdbcType=TIMESTAMP},
end_date = #{end_date,jdbcType=TIMESTAMP}
where history_id = #{history_id,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -0,0 +1,256 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionMapper">
<resultMap id="BaseResultMap" type="net.sourceforge.guacamole.net.auth.mysql.model.Connection">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<id column="connection_id" jdbcType="INTEGER" property="connection_id" />
<result column="connection_name" jdbcType="VARCHAR" property="connection_name" />
<result column="protocol" jdbcType="VARCHAR" property="protocol" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
connection_id, connection_name, protocol
</sql>
<select id="selectByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from guacamole.guacamole_connection
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select
<include refid="Base_Column_List" />
from guacamole.guacamole_connection
where connection_id = #{connection_id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
delete from guacamole.guacamole_connection
where connection_id = #{connection_id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
delete from guacamole.guacamole_connection
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.Connection">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
insert into guacamole.guacamole_connection (connection_id, connection_name, protocol
)
values (#{connection_id,jdbcType=INTEGER}, #{connection_name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.Connection">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
insert into guacamole.guacamole_connection
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="connection_id != null">
connection_id,
</if>
<if test="connection_name != null">
connection_name,
</if>
<if test="protocol != null">
protocol,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="connection_id != null">
#{connection_id,jdbcType=INTEGER},
</if>
<if test="connection_name != null">
#{connection_name,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
#{protocol,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample" resultType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select count(*) from guacamole.guacamole_connection
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_connection
<set>
<if test="record.connection_id != null">
connection_id = #{record.connection_id,jdbcType=INTEGER},
</if>
<if test="record.connection_name != null">
connection_name = #{record.connection_name,jdbcType=VARCHAR},
</if>
<if test="record.protocol != null">
protocol = #{record.protocol,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_connection
set connection_id = #{record.connection_id,jdbcType=INTEGER},
connection_name = #{record.connection_name,jdbcType=VARCHAR},
protocol = #{record.protocol,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.Connection">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_connection
<set>
<if test="connection_name != null">
connection_name = #{connection_name,jdbcType=VARCHAR},
</if>
<if test="protocol != null">
protocol = #{protocol,jdbcType=VARCHAR},
</if>
</set>
where connection_id = #{connection_id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.Connection">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_connection
set connection_name = #{connection_name,jdbcType=VARCHAR},
protocol = #{protocol,jdbcType=VARCHAR}
where connection_id = #{connection_id,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -0,0 +1,256 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionParameterMapper">
<resultMap id="BaseResultMap" type="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<id column="connection_id" jdbcType="INTEGER" property="connection_id" />
<id column="parameter_name" jdbcType="VARCHAR" property="parameter_name" />
<result column="parameter_value" jdbcType="VARCHAR" property="parameter_value" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
connection_id, parameter_name, parameter_value
</sql>
<select id="selectByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from guacamole.guacamole_connection_parameter
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterKey" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select
<include refid="Base_Column_List" />
from guacamole.guacamole_connection_parameter
where connection_id = #{connection_id,jdbcType=INTEGER}
and parameter_name = #{parameter_name,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterKey">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
delete from guacamole.guacamole_connection_parameter
where connection_id = #{connection_id,jdbcType=INTEGER}
and parameter_name = #{parameter_name,jdbcType=VARCHAR}
</delete>
<delete id="deleteByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
delete from guacamole.guacamole_connection_parameter
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
insert into guacamole.guacamole_connection_parameter (connection_id, parameter_name, parameter_value
)
values (#{connection_id,jdbcType=INTEGER}, #{parameter_name,jdbcType=VARCHAR}, #{parameter_value,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
insert into guacamole.guacamole_connection_parameter
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="connection_id != null">
connection_id,
</if>
<if test="parameter_name != null">
parameter_name,
</if>
<if test="parameter_value != null">
parameter_value,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="connection_id != null">
#{connection_id,jdbcType=INTEGER},
</if>
<if test="parameter_name != null">
#{parameter_name,jdbcType=VARCHAR},
</if>
<if test="parameter_value != null">
#{parameter_value,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameterExample" resultType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select count(*) from guacamole.guacamole_connection_parameter
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_connection_parameter
<set>
<if test="record.connection_id != null">
connection_id = #{record.connection_id,jdbcType=INTEGER},
</if>
<if test="record.parameter_name != null">
parameter_name = #{record.parameter_name,jdbcType=VARCHAR},
</if>
<if test="record.parameter_value != null">
parameter_value = #{record.parameter_value,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_connection_parameter
set connection_id = #{record.connection_id,jdbcType=INTEGER},
parameter_name = #{record.parameter_name,jdbcType=VARCHAR},
parameter_value = #{record.parameter_value,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_connection_parameter
<set>
<if test="parameter_value != null">
parameter_value = #{parameter_value,jdbcType=VARCHAR},
</if>
</set>
where connection_id = #{connection_id,jdbcType=INTEGER}
and parameter_name = #{parameter_name,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionParameter">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_connection_parameter
set parameter_value = #{parameter_value,jdbcType=VARCHAR}
where connection_id = #{connection_id,jdbcType=INTEGER}
and parameter_name = #{parameter_name,jdbcType=VARCHAR}
</update>
</mapper>

View File

@@ -0,0 +1,219 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.sourceforge.guacamole.net.auth.mysql.dao.ConnectionPermissionMapper">
<resultMap id="BaseResultMap" type="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<id column="user_id" jdbcType="INTEGER" property="user_id" />
<id column="connection_id" jdbcType="INTEGER" property="connection_id" />
<id column="permission" jdbcType="CHAR" property="permission" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
user_id, connection_id, permission
</sql>
<select id="selectByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from guacamole.guacamole_connection_permission
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
delete from guacamole.guacamole_connection_permission
where user_id = #{user_id,jdbcType=INTEGER}
and connection_id = #{connection_id,jdbcType=INTEGER}
and permission = #{permission,jdbcType=CHAR}
</delete>
<delete id="deleteByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
delete from guacamole.guacamole_connection_permission
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
insert into guacamole.guacamole_connection_permission (user_id, connection_id, permission
)
values (#{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR}
)
</insert>
<insert id="insertSelective" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionKey">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
insert into guacamole.guacamole_connection_permission
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="user_id != null">
user_id,
</if>
<if test="connection_id != null">
connection_id,
</if>
<if test="permission != null">
permission,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="user_id != null">
#{user_id,jdbcType=INTEGER},
</if>
<if test="connection_id != null">
#{connection_id,jdbcType=INTEGER},
</if>
<if test="permission != null">
#{permission,jdbcType=CHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionPermissionExample" resultType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select count(*) from guacamole.guacamole_connection_permission
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_connection_permission
<set>
<if test="record.user_id != null">
user_id = #{record.user_id,jdbcType=INTEGER},
</if>
<if test="record.connection_id != null">
connection_id = #{record.connection_id,jdbcType=INTEGER},
</if>
<if test="record.permission != null">
permission = #{record.permission,jdbcType=CHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_connection_permission
set user_id = #{record.user_id,jdbcType=INTEGER},
connection_id = #{record.connection_id,jdbcType=INTEGER},
permission = #{record.permission,jdbcType=CHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
</mapper>

View File

@@ -0,0 +1,205 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.sourceforge.guacamole.net.auth.mysql.dao.SystemPermissionMapper">
<resultMap id="BaseResultMap" type="net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionKey">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<id column="user_id" jdbcType="INTEGER" property="user_id" />
<id column="permission" jdbcType="CHAR" property="permission" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
user_id, permission
</sql>
<select id="selectByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionExample" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from guacamole.guacamole_system_permission
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionKey">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
delete from guacamole.guacamole_system_permission
where user_id = #{user_id,jdbcType=INTEGER}
and permission = #{permission,jdbcType=CHAR}
</delete>
<delete id="deleteByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionExample">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
delete from guacamole.guacamole_system_permission
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionKey">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
insert into guacamole.guacamole_system_permission (user_id, permission)
values (#{user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR})
</insert>
<insert id="insertSelective" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionKey">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
insert into guacamole.guacamole_system_permission
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="user_id != null">
user_id,
</if>
<if test="permission != null">
permission,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="user_id != null">
#{user_id,jdbcType=INTEGER},
</if>
<if test="permission != null">
#{permission,jdbcType=CHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionExample" resultType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select count(*) from guacamole.guacamole_system_permission
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_system_permission
<set>
<if test="record.user_id != null">
user_id = #{record.user_id,jdbcType=INTEGER},
</if>
<if test="record.permission != null">
permission = #{record.permission,jdbcType=CHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_system_permission
set user_id = #{record.user_id,jdbcType=INTEGER},
permission = #{record.permission,jdbcType=CHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
</mapper>

View File

@@ -0,0 +1,332 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.sourceforge.guacamole.net.auth.mysql.dao.UserMapper">
<resultMap id="BaseResultMap" type="net.sourceforge.guacamole.net.auth.mysql.model.User">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<id column="user_id" jdbcType="INTEGER" property="user_id" />
<result column="username" jdbcType="VARCHAR" property="username" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<result column="password_hash" jdbcType="BINARY" property="password_hash" />
<result column="password_salt" jdbcType="BINARY" property="password_salt" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
user_id, username
</sql>
<sql id="Blob_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
password_hash, password_salt
</sql>
<select id="selectByExampleWithBLOBs" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.UserExample" resultMap="ResultMapWithBLOBs">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from guacamole.guacamole_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.UserExample" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from guacamole.guacamole_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="ResultMapWithBLOBs">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select
<include refid="Base_Column_List" />
,
<include refid="Blob_Column_List" />
from guacamole.guacamole_user
where user_id = #{user_id,jdbcType=INTEGER}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
delete from guacamole.guacamole_user
where user_id = #{user_id,jdbcType=INTEGER}
</delete>
<delete id="deleteByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.UserExample">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
delete from guacamole.guacamole_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
insert into guacamole.guacamole_user (user_id, username, password_hash,
password_salt)
values (#{user_id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password_hash,jdbcType=BINARY},
#{password_salt,jdbcType=BINARY})
</insert>
<insert id="insertSelective" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
insert into guacamole.guacamole_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="user_id != null">
user_id,
</if>
<if test="username != null">
username,
</if>
<if test="password_hash != null">
password_hash,
</if>
<if test="password_salt != null">
password_salt,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="user_id != null">
#{user_id,jdbcType=INTEGER},
</if>
<if test="username != null">
#{username,jdbcType=VARCHAR},
</if>
<if test="password_hash != null">
#{password_hash,jdbcType=BINARY},
</if>
<if test="password_salt != null">
#{password_salt,jdbcType=BINARY},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.UserExample" resultType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select count(*) from guacamole.guacamole_user
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_user
<set>
<if test="record.user_id != null">
user_id = #{record.user_id,jdbcType=INTEGER},
</if>
<if test="record.username != null">
username = #{record.username,jdbcType=VARCHAR},
</if>
<if test="record.password_hash != null">
password_hash = #{record.password_hash,jdbcType=BINARY},
</if>
<if test="record.password_salt != null">
password_salt = #{record.password_salt,jdbcType=BINARY},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExampleWithBLOBs" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_user
set user_id = #{record.user_id,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR},
password_hash = #{record.password_hash,jdbcType=BINARY},
password_salt = #{record.password_salt,jdbcType=BINARY}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_user
set user_id = #{record.user_id,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_user
<set>
<if test="username != null">
username = #{username,jdbcType=VARCHAR},
</if>
<if test="password_hash != null">
password_hash = #{password_hash,jdbcType=BINARY},
</if>
<if test="password_salt != null">
password_salt = #{password_salt,jdbcType=BINARY},
</if>
</set>
where user_id = #{user_id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKeyWithBLOBs" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.UserWithBLOBs">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_user
set username = #{username,jdbcType=VARCHAR},
password_hash = #{password_hash,jdbcType=BINARY},
password_salt = #{password_salt,jdbcType=BINARY}
where user_id = #{user_id,jdbcType=INTEGER}
</update>
<update id="updateByPrimaryKey" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.User">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_user
set username = #{username,jdbcType=VARCHAR}
where user_id = #{user_id,jdbcType=INTEGER}
</update>
</mapper>

View File

@@ -0,0 +1,219 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="net.sourceforge.guacamole.net.auth.mysql.dao.UserPermissionMapper">
<resultMap id="BaseResultMap" type="net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<id column="user_id" jdbcType="INTEGER" property="user_id" />
<id column="affected_user_id" jdbcType="INTEGER" property="affected_user_id" />
<id column="permission" jdbcType="CHAR" property="permission" />
</resultMap>
<sql id="Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<where>
<foreach collection="oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
<where>
<foreach collection="example.oredCriteria" item="criteria" separator="or">
<if test="criteria.valid">
<trim prefix="(" prefixOverrides="and" suffix=")">
<foreach collection="criteria.criteria" item="criterion">
<choose>
<when test="criterion.noValue">
and ${criterion.condition}
</when>
<when test="criterion.singleValue">
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue">
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue">
and ${criterion.condition}
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
user_id, affected_user_id, permission
</sql>
<select id="selectByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select
<if test="distinct">
distinct
</if>
<include refid="Base_Column_List" />
from guacamole.guacamole_user_permission
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null">
order by ${orderByClause}
</if>
</select>
<delete id="deleteByPrimaryKey" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
delete from guacamole.guacamole_user_permission
where user_id = #{user_id,jdbcType=INTEGER}
and affected_user_id = #{affected_user_id,jdbcType=INTEGER}
and permission = #{permission,jdbcType=CHAR}
</delete>
<delete id="deleteByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
delete from guacamole.guacamole_user_permission
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
insert into guacamole.guacamole_user_permission (user_id, affected_user_id, permission
)
values (#{user_id,jdbcType=INTEGER}, #{affected_user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR}
)
</insert>
<insert id="insertSelective" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionKey">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
insert into guacamole.guacamole_user_permission
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="user_id != null">
user_id,
</if>
<if test="affected_user_id != null">
affected_user_id,
</if>
<if test="permission != null">
permission,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="user_id != null">
#{user_id,jdbcType=INTEGER},
</if>
<if test="affected_user_id != null">
#{affected_user_id,jdbcType=INTEGER},
</if>
<if test="permission != null">
#{permission,jdbcType=CHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.UserPermissionExample" resultType="java.lang.Integer">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
select count(*) from guacamole.guacamole_user_permission
<if test="_parameter != null">
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_user_permission
<set>
<if test="record.user_id != null">
user_id = #{record.user_id,jdbcType=INTEGER},
</if>
<if test="record.affected_user_id != null">
affected_user_id = #{record.affected_user_id,jdbcType=INTEGER},
</if>
<if test="record.permission != null">
permission = #{record.permission,jdbcType=CHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013.
-->
update guacamole.guacamole_user_permission
set user_id = #{record.user_id,jdbcType=INTEGER},
affected_user_id = #{record.affected_user_id,jdbcType=INTEGER},
permission = #{record.permission,jdbcType=CHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
</mapper>