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

@@ -89,6 +89,11 @@ public class MySQLAuthenticationProvider implements AuthenticationProvider {
@Override @Override
public UserContext getUserContext(Credentials credentials) throws GuacamoleException { public UserContext getUserContext(Credentials credentials) throws GuacamoleException {
// No null users in database
if (credentials.getUsername() == null)
return null;
MySQLUserContext context = injector.getInstance(MySQLUserContext.class); MySQLUserContext context = injector.getInstance(MySQLUserContext.class);
context.init(credentials); context.init(credentials);
return context; return context;

View File

@@ -87,19 +87,33 @@ public class MySQLUser implements User {
* @throws GuacamoleException * @throws GuacamoleException
*/ */
void init(Credentials credentials) throws GuacamoleException { void init(Credentials credentials) throws GuacamoleException {
// Query user
UserExample userExample = new UserExample(); UserExample userExample = new UserExample();
userExample.createCriteria().andUsernameEqualTo(credentials.getUsername()); userExample.createCriteria().andUsernameEqualTo(credentials.getUsername());
List<UserWithBLOBs> users = userDAO.selectByExampleWithBLOBs(userExample); List<UserWithBLOBs> users = userDAO.selectByExampleWithBLOBs(userExample);
if(users.size() > 1) // the unique constraint on the table should prevent this
throw new GuacamoleException("Multiple users found with the same username: " + credentials.getUsername()); // The unique constraint on the table should prevent this.
if (users.size() > 1)
throw new GuacamoleException(
"Multiple users found with the same username: "
+ credentials.getUsername());
// Check that a user was found
if (users.isEmpty()) if (users.isEmpty())
throw new GuacamoleException("No user found with the supplied credentials"); throw new GuacamoleException("No user found with the supplied credentials");
// Get first (and only) user
user = users.get(0); user = users.get(0);
// check password
if(!passwordUtility.checkCredentials(credentials, user.getPassword_hash(), user.getUsername(), user.getPassword_salt())) // Check password
if (!passwordUtility.checkCredentials(credentials,
user.getPassword_hash(), user.getUsername(), user.getPassword_salt()))
throw new GuacamoleException("No user found with the supplied credentials"); throw new GuacamoleException("No user found with the supplied credentials");
// Init permissions
this.permissions = permissionCheckUtility.getAllPermissions(user.getUser_id()); this.permissions = permissionCheckUtility.getAllPermissions(user.getUser_id());
} }
/** /**

View File

@@ -100,7 +100,7 @@
distinct distinct
</if> </if>
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from guacamole..guacamole_connection_history from guacamole.guacamole_connection_history
<if test="_parameter != null" > <if test="_parameter != null" >
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -116,7 +116,7 @@
--> -->
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from guacamole..guacamole_connection_history from guacamole.guacamole_connection_history
where history_id = #{history_id,jdbcType=INTEGER} where history_id = #{history_id,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" > <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
@@ -125,7 +125,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
delete from guacamole..guacamole_connection_history delete from guacamole.guacamole_connection_history
where history_id = #{history_id,jdbcType=INTEGER} where history_id = #{history_id,jdbcType=INTEGER}
</delete> </delete>
<delete id="deleteByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistoryExample" > <delete id="deleteByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionHistoryExample" >
@@ -134,7 +134,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
delete from guacamole..guacamole_connection_history delete from guacamole.guacamole_connection_history
<if test="_parameter != null" > <if test="_parameter != null" >
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -145,7 +145,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. 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, insert into guacamole.guacamole_connection_history (history_id, user_id, connection_id,
start_date, end_date) start_date, end_date)
values (#{history_id,jdbcType=INTEGER}, #{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, values (#{history_id,jdbcType=INTEGER}, #{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER},
#{start_date,jdbcType=TIMESTAMP}, #{end_date,jdbcType=TIMESTAMP}) #{start_date,jdbcType=TIMESTAMP}, #{end_date,jdbcType=TIMESTAMP})
@@ -156,7 +156,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
insert into guacamole..guacamole_connection_history insert into guacamole.guacamole_connection_history
<trim prefix="(" suffix=")" suffixOverrides="," > <trim prefix="(" suffix=")" suffixOverrides="," >
<if test="history_id != null" > <if test="history_id != null" >
history_id, history_id,
@@ -198,7 +198,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
select count(*) from guacamole..guacamole_connection_history select count(*) from guacamole.guacamole_connection_history
<if test="_parameter != null" > <if test="_parameter != null" >
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -209,7 +209,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_connection_history update guacamole.guacamole_connection_history
<set > <set >
<if test="record.history_id != null" > <if test="record.history_id != null" >
history_id = #{record.history_id,jdbcType=INTEGER}, history_id = #{record.history_id,jdbcType=INTEGER},
@@ -237,7 +237,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_connection_history update guacamole.guacamole_connection_history
set history_id = #{record.history_id,jdbcType=INTEGER}, set history_id = #{record.history_id,jdbcType=INTEGER},
user_id = #{record.user_id,jdbcType=INTEGER}, user_id = #{record.user_id,jdbcType=INTEGER},
connection_id = #{record.connection_id,jdbcType=INTEGER}, connection_id = #{record.connection_id,jdbcType=INTEGER},
@@ -253,7 +253,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_connection_history update guacamole.guacamole_connection_history
<set > <set >
<if test="user_id != null" > <if test="user_id != null" >
user_id = #{user_id,jdbcType=INTEGER}, user_id = #{user_id,jdbcType=INTEGER},
@@ -276,7 +276,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_connection_history update guacamole.guacamole_connection_history
set user_id = #{user_id,jdbcType=INTEGER}, set user_id = #{user_id,jdbcType=INTEGER},
connection_id = #{connection_id,jdbcType=INTEGER}, connection_id = #{connection_id,jdbcType=INTEGER},
start_date = #{start_date,jdbcType=TIMESTAMP}, start_date = #{start_date,jdbcType=TIMESTAMP},

View File

@@ -98,7 +98,7 @@
distinct distinct
</if> </if>
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from guacamole..guacamole_connection from guacamole.guacamole_connection
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -114,7 +114,7 @@
--> -->
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from guacamole..guacamole_connection from guacamole.guacamole_connection
where connection_id = #{connection_id,jdbcType=INTEGER} where connection_id = #{connection_id,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
@@ -123,7 +123,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
delete from guacamole..guacamole_connection delete from guacamole.guacamole_connection
where connection_id = #{connection_id,jdbcType=INTEGER} where connection_id = #{connection_id,jdbcType=INTEGER}
</delete> </delete>
<delete id="deleteByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample"> <delete id="deleteByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.ConnectionExample">
@@ -132,7 +132,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
delete from guacamole..guacamole_connection delete from guacamole.guacamole_connection
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -143,7 +143,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
insert into guacamole..guacamole_connection (connection_id, connection_name, protocol insert into guacamole.guacamole_connection (connection_id, connection_name, protocol
) )
values (#{connection_id,jdbcType=INTEGER}, #{connection_name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR} values (#{connection_id,jdbcType=INTEGER}, #{connection_name,jdbcType=VARCHAR}, #{protocol,jdbcType=VARCHAR}
) )
@@ -154,7 +154,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
insert into guacamole..guacamole_connection insert into guacamole.guacamole_connection
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="connection_id != null"> <if test="connection_id != null">
connection_id, connection_id,
@@ -184,7 +184,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
select count(*) from guacamole..guacamole_connection select count(*) from guacamole.guacamole_connection
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -195,7 +195,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_connection update guacamole.guacamole_connection
<set> <set>
<if test="record.connection_id != null"> <if test="record.connection_id != null">
connection_id = #{record.connection_id,jdbcType=INTEGER}, connection_id = #{record.connection_id,jdbcType=INTEGER},
@@ -217,7 +217,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_connection update guacamole.guacamole_connection
set connection_id = #{record.connection_id,jdbcType=INTEGER}, set connection_id = #{record.connection_id,jdbcType=INTEGER},
connection_name = #{record.connection_name,jdbcType=VARCHAR}, connection_name = #{record.connection_name,jdbcType=VARCHAR},
protocol = #{record.protocol,jdbcType=VARCHAR} protocol = #{record.protocol,jdbcType=VARCHAR}
@@ -231,7 +231,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_connection update guacamole.guacamole_connection
<set> <set>
<if test="connection_name != null"> <if test="connection_name != null">
connection_name = #{connection_name,jdbcType=VARCHAR}, connection_name = #{connection_name,jdbcType=VARCHAR},
@@ -248,7 +248,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_connection update guacamole.guacamole_connection
set connection_name = #{connection_name,jdbcType=VARCHAR}, set connection_name = #{connection_name,jdbcType=VARCHAR},
protocol = #{protocol,jdbcType=VARCHAR} protocol = #{protocol,jdbcType=VARCHAR}
where connection_id = #{connection_id,jdbcType=INTEGER} where connection_id = #{connection_id,jdbcType=INTEGER}

View File

@@ -98,7 +98,7 @@
distinct distinct
</if> </if>
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from guacamole..guacamole_connection_parameter from guacamole.guacamole_connection_parameter
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -114,7 +114,7 @@
--> -->
select select
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from guacamole..guacamole_connection_parameter from guacamole.guacamole_connection_parameter
where connection_id = #{connection_id,jdbcType=INTEGER} where connection_id = #{connection_id,jdbcType=INTEGER}
and parameter_name = #{parameter_name,jdbcType=VARCHAR} and parameter_name = #{parameter_name,jdbcType=VARCHAR}
</select> </select>
@@ -124,7 +124,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
delete from guacamole..guacamole_connection_parameter delete from guacamole.guacamole_connection_parameter
where connection_id = #{connection_id,jdbcType=INTEGER} where connection_id = #{connection_id,jdbcType=INTEGER}
and parameter_name = #{parameter_name,jdbcType=VARCHAR} and parameter_name = #{parameter_name,jdbcType=VARCHAR}
</delete> </delete>
@@ -134,7 +134,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
delete from guacamole..guacamole_connection_parameter delete from guacamole.guacamole_connection_parameter
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -145,7 +145,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. 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 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} values (#{connection_id,jdbcType=INTEGER}, #{parameter_name,jdbcType=VARCHAR}, #{parameter_value,jdbcType=VARCHAR}
) )
@@ -156,7 +156,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
insert into guacamole..guacamole_connection_parameter insert into guacamole.guacamole_connection_parameter
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="connection_id != null"> <if test="connection_id != null">
connection_id, connection_id,
@@ -186,7 +186,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
select count(*) from guacamole..guacamole_connection_parameter select count(*) from guacamole.guacamole_connection_parameter
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -197,7 +197,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_connection_parameter update guacamole.guacamole_connection_parameter
<set> <set>
<if test="record.connection_id != null"> <if test="record.connection_id != null">
connection_id = #{record.connection_id,jdbcType=INTEGER}, connection_id = #{record.connection_id,jdbcType=INTEGER},
@@ -219,7 +219,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_connection_parameter update guacamole.guacamole_connection_parameter
set connection_id = #{record.connection_id,jdbcType=INTEGER}, set connection_id = #{record.connection_id,jdbcType=INTEGER},
parameter_name = #{record.parameter_name,jdbcType=VARCHAR}, parameter_name = #{record.parameter_name,jdbcType=VARCHAR},
parameter_value = #{record.parameter_value,jdbcType=VARCHAR} parameter_value = #{record.parameter_value,jdbcType=VARCHAR}
@@ -233,7 +233,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_connection_parameter update guacamole.guacamole_connection_parameter
<set> <set>
<if test="parameter_value != null"> <if test="parameter_value != null">
parameter_value = #{parameter_value,jdbcType=VARCHAR}, parameter_value = #{parameter_value,jdbcType=VARCHAR},
@@ -248,7 +248,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_connection_parameter update guacamole.guacamole_connection_parameter
set parameter_value = #{parameter_value,jdbcType=VARCHAR} set parameter_value = #{parameter_value,jdbcType=VARCHAR}
where connection_id = #{connection_id,jdbcType=INTEGER} where connection_id = #{connection_id,jdbcType=INTEGER}
and parameter_name = #{parameter_name,jdbcType=VARCHAR} and parameter_name = #{parameter_name,jdbcType=VARCHAR}

View File

@@ -98,7 +98,7 @@
distinct distinct
</if> </if>
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from guacamole..guacamole_connection_permission from guacamole.guacamole_connection_permission
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -112,7 +112,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
delete from guacamole..guacamole_connection_permission delete from guacamole.guacamole_connection_permission
where user_id = #{user_id,jdbcType=INTEGER} where user_id = #{user_id,jdbcType=INTEGER}
and connection_id = #{connection_id,jdbcType=INTEGER} and connection_id = #{connection_id,jdbcType=INTEGER}
and permission = #{permission,jdbcType=CHAR} and permission = #{permission,jdbcType=CHAR}
@@ -123,7 +123,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
delete from guacamole..guacamole_connection_permission delete from guacamole.guacamole_connection_permission
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -134,7 +134,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
insert into guacamole..guacamole_connection_permission (user_id, connection_id, permission insert into guacamole.guacamole_connection_permission (user_id, connection_id, permission
) )
values (#{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR} values (#{user_id,jdbcType=INTEGER}, #{connection_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR}
) )
@@ -145,7 +145,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
insert into guacamole..guacamole_connection_permission insert into guacamole.guacamole_connection_permission
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="user_id != null"> <if test="user_id != null">
user_id, user_id,
@@ -175,7 +175,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
select count(*) from guacamole..guacamole_connection_permission select count(*) from guacamole.guacamole_connection_permission
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -186,7 +186,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_connection_permission update guacamole.guacamole_connection_permission
<set> <set>
<if test="record.user_id != null"> <if test="record.user_id != null">
user_id = #{record.user_id,jdbcType=INTEGER}, user_id = #{record.user_id,jdbcType=INTEGER},
@@ -208,7 +208,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_connection_permission update guacamole.guacamole_connection_permission
set user_id = #{record.user_id,jdbcType=INTEGER}, set user_id = #{record.user_id,jdbcType=INTEGER},
connection_id = #{record.connection_id,jdbcType=INTEGER}, connection_id = #{record.connection_id,jdbcType=INTEGER},
permission = #{record.permission,jdbcType=CHAR} permission = #{record.permission,jdbcType=CHAR}

View File

@@ -97,7 +97,7 @@
distinct distinct
</if> </if>
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from guacamole..guacamole_system_permission from guacamole.guacamole_system_permission
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -111,7 +111,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
delete from guacamole..guacamole_system_permission delete from guacamole.guacamole_system_permission
where user_id = #{user_id,jdbcType=INTEGER} where user_id = #{user_id,jdbcType=INTEGER}
and permission = #{permission,jdbcType=CHAR} and permission = #{permission,jdbcType=CHAR}
</delete> </delete>
@@ -121,7 +121,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
delete from guacamole..guacamole_system_permission delete from guacamole.guacamole_system_permission
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -132,7 +132,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
insert into guacamole..guacamole_system_permission (user_id, permission) insert into guacamole.guacamole_system_permission (user_id, permission)
values (#{user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR}) values (#{user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionKey"> <insert id="insertSelective" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.SystemPermissionKey">
@@ -141,7 +141,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
insert into guacamole..guacamole_system_permission insert into guacamole.guacamole_system_permission
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="user_id != null"> <if test="user_id != null">
user_id, user_id,
@@ -165,7 +165,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
select count(*) from guacamole..guacamole_system_permission select count(*) from guacamole.guacamole_system_permission
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -176,7 +176,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_system_permission update guacamole.guacamole_system_permission
<set> <set>
<if test="record.user_id != null"> <if test="record.user_id != null">
user_id = #{record.user_id,jdbcType=INTEGER}, user_id = #{record.user_id,jdbcType=INTEGER},
@@ -195,7 +195,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_system_permission update guacamole.guacamole_system_permission
set user_id = #{record.user_id,jdbcType=INTEGER}, set user_id = #{record.user_id,jdbcType=INTEGER},
permission = #{record.permission,jdbcType=CHAR} permission = #{record.permission,jdbcType=CHAR}
<if test="_parameter != null"> <if test="_parameter != null">

View File

@@ -116,7 +116,7 @@
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
, ,
<include refid="Blob_Column_List" /> <include refid="Blob_Column_List" />
from guacamole..guacamole_user from guacamole.guacamole_user
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -135,7 +135,7 @@
distinct distinct
</if> </if>
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from guacamole..guacamole_user from guacamole.guacamole_user
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -153,7 +153,7 @@
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
, ,
<include refid="Blob_Column_List" /> <include refid="Blob_Column_List" />
from guacamole..guacamole_user from guacamole.guacamole_user
where user_id = #{user_id,jdbcType=INTEGER} where user_id = #{user_id,jdbcType=INTEGER}
</select> </select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer"> <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
@@ -162,7 +162,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
delete from guacamole..guacamole_user delete from guacamole.guacamole_user
where user_id = #{user_id,jdbcType=INTEGER} where user_id = #{user_id,jdbcType=INTEGER}
</delete> </delete>
<delete id="deleteByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.UserExample"> <delete id="deleteByExample" parameterType="net.sourceforge.guacamole.net.auth.mysql.model.UserExample">
@@ -171,7 +171,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
delete from guacamole..guacamole_user delete from guacamole.guacamole_user
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -182,7 +182,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
insert into guacamole..guacamole_user (user_id, username, password_hash, insert into guacamole.guacamole_user (user_id, username, password_hash,
password_salt) password_salt)
values (#{user_id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password_hash,jdbcType=BINARY}, values (#{user_id,jdbcType=INTEGER}, #{username,jdbcType=VARCHAR}, #{password_hash,jdbcType=BINARY},
#{password_salt,jdbcType=BINARY}) #{password_salt,jdbcType=BINARY})
@@ -193,7 +193,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
insert into guacamole..guacamole_user insert into guacamole.guacamole_user
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="user_id != null"> <if test="user_id != null">
user_id, user_id,
@@ -229,7 +229,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
select count(*) from guacamole..guacamole_user select count(*) from guacamole.guacamole_user
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -240,7 +240,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_user update guacamole.guacamole_user
<set> <set>
<if test="record.user_id != null"> <if test="record.user_id != null">
user_id = #{record.user_id,jdbcType=INTEGER}, user_id = #{record.user_id,jdbcType=INTEGER},
@@ -265,7 +265,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_user update guacamole.guacamole_user
set user_id = #{record.user_id,jdbcType=INTEGER}, set user_id = #{record.user_id,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR}, username = #{record.username,jdbcType=VARCHAR},
password_hash = #{record.password_hash,jdbcType=BINARY}, password_hash = #{record.password_hash,jdbcType=BINARY},
@@ -280,7 +280,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_user update guacamole.guacamole_user
set user_id = #{record.user_id,jdbcType=INTEGER}, set user_id = #{record.user_id,jdbcType=INTEGER},
username = #{record.username,jdbcType=VARCHAR} username = #{record.username,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
@@ -293,7 +293,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_user update guacamole.guacamole_user
<set> <set>
<if test="username != null"> <if test="username != null">
username = #{username,jdbcType=VARCHAR}, username = #{username,jdbcType=VARCHAR},
@@ -313,7 +313,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_user update guacamole.guacamole_user
set username = #{username,jdbcType=VARCHAR}, set username = #{username,jdbcType=VARCHAR},
password_hash = #{password_hash,jdbcType=BINARY}, password_hash = #{password_hash,jdbcType=BINARY},
password_salt = #{password_salt,jdbcType=BINARY} password_salt = #{password_salt,jdbcType=BINARY}
@@ -325,7 +325,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_user update guacamole.guacamole_user
set username = #{username,jdbcType=VARCHAR} set username = #{username,jdbcType=VARCHAR}
where user_id = #{user_id,jdbcType=INTEGER} where user_id = #{user_id,jdbcType=INTEGER}
</update> </update>

View File

@@ -98,7 +98,7 @@
distinct distinct
</if> </if>
<include refid="Base_Column_List" /> <include refid="Base_Column_List" />
from guacamole..guacamole_user_permission from guacamole.guacamole_user_permission
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -112,7 +112,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
delete from guacamole..guacamole_user_permission delete from guacamole.guacamole_user_permission
where user_id = #{user_id,jdbcType=INTEGER} where user_id = #{user_id,jdbcType=INTEGER}
and affected_user_id = #{affected_user_id,jdbcType=INTEGER} and affected_user_id = #{affected_user_id,jdbcType=INTEGER}
and permission = #{permission,jdbcType=CHAR} and permission = #{permission,jdbcType=CHAR}
@@ -123,7 +123,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
delete from guacamole..guacamole_user_permission delete from guacamole.guacamole_user_permission
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -134,7 +134,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. 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 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} values (#{user_id,jdbcType=INTEGER}, #{affected_user_id,jdbcType=INTEGER}, #{permission,jdbcType=CHAR}
) )
@@ -145,7 +145,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
insert into guacamole..guacamole_user_permission insert into guacamole.guacamole_user_permission
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="user_id != null"> <if test="user_id != null">
user_id, user_id,
@@ -175,7 +175,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
select count(*) from guacamole..guacamole_user_permission select count(*) from guacamole.guacamole_user_permission
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Example_Where_Clause" /> <include refid="Example_Where_Clause" />
</if> </if>
@@ -186,7 +186,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_user_permission update guacamole.guacamole_user_permission
<set> <set>
<if test="record.user_id != null"> <if test="record.user_id != null">
user_id = #{record.user_id,jdbcType=INTEGER}, user_id = #{record.user_id,jdbcType=INTEGER},
@@ -208,7 +208,7 @@
This element is automatically generated by MyBatis Generator, do not modify. This element is automatically generated by MyBatis Generator, do not modify.
This element was generated on Tue Feb 19 23:09:22 PST 2013. This element was generated on Tue Feb 19 23:09:22 PST 2013.
--> -->
update guacamole..guacamole_user_permission update guacamole.guacamole_user_permission
set user_id = #{record.user_id,jdbcType=INTEGER}, set user_id = #{record.user_id,jdbcType=INTEGER},
affected_user_id = #{record.affected_user_id,jdbcType=INTEGER}, affected_user_id = #{record.affected_user_id,jdbcType=INTEGER},
permission = #{record.permission,jdbcType=CHAR} permission = #{record.permission,jdbcType=CHAR}