All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.jinahya.openfire.persistence.ibatis.mapper.OfMucRoomMapper.xml Maven / Gradle / Ivy

There is a newer version: 0.1.9
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2017 Jin Kwon &lt;onacit at gmail.com&gt;.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!DOCTYPE mapper PUBLIC '-//mybatis.org//DTD Mapper 3.0//EN' 'http://mybatis.org/dtd/mybatis-3-mapper.dtd'>

<mapper namespace="com.github.jinahya.openfire.persistence.ibatis.mapper.OfMucRoomMapper">
    
  <resultMap id="resultMap" type="com.github.jinahya.openfire.persistence.OfMucRoom">
    <id column="roomID" property="roomId"/>
    <result column="creationDate" property="creationDate"
            typeHandler="com.github.jinahya.openfire.persistence.ibatis.type.Date015TypeHandler"/>
    <result column="modificationDate" property="modificationDate"
            typeHandler="com.github.jinahya.openfire.persistence.ibatis.type.Date015TypeHandler"/>
    <result column="name" property="name"/>
    <result column="naturalName" property="naturalName"/>
    <result column="description" property="description"/>
    <result column="lockedDate" property="lockedDate"
            typeHandler="com.github.jinahya.openfire.persistence.ibatis.type.Date015TypeHandler"/>
    <result column="emptyDate" property="emptyDate"
            typeHandler="com.github.jinahya.openfire.persistence.ibatis.type.Date015TypeHandler"/>
    <result column="canChangeSubject" property="canChangeSubject"/>
    <result column="maxUsers" property="maxUsers"/>
    <result column="publicRoom" property="publicRoom"/>
    <result column="moderated" property="moderated"/>
    <result column="membersOnly" property="membersOnly"/>
    <result column="canInvite" property="canInvite"/>
    <result column="roomPassword" property="roomPassword"/>
    <result column="canDiscoverJID" property="canDiscoverJid"/>
    <result column="logEnabled" property="logEnabled"/>
    <result column="subject" property="subject"/>
    <result column="rolesToBroadcast" property="rolesToBroadcast"/>
    <result column="useReservedNick" property="useReservedNick"/>
    <result column="canChangeNick" property="canChangeNick"/>
    <result column="canRegister" property="canRegister"/>
    <result column="allowpm" property="allowpm"/>
  </resultMap>

  <resultMap id="resultMapAssociative" type="com.github.jinahya.openfire.persistence.OfMucRoom">
    <id column="ofMucRoom_roomID" property="roomId"/>
    <result column="ofMucRoom_creationDate" property="creationDate"
            typeHandler="com.github.jinahya.openfire.persistence.ibatis.type.Date015TypeHandler"/>
    <result column="ofMucRoom_modificationDate" property="modificationDate"
            typeHandler="com.github.jinahya.openfire.persistence.ibatis.type.Date015TypeHandler"/>
    <result column="ofMucRoom_name" property="name"/>
    <result column="ofMucRoom_naturalName" property="naturalName"/>
    <result column="ofMucRoom_description" property="description"/>
    <result column="ofMucRoom_lockedDate" property="lockedDate"
            typeHandler="com.github.jinahya.openfire.persistence.ibatis.type.Date015TypeHandler"/>
    <result column="ofMucRoom_emptyDate" property="emptyDate"
            typeHandler="com.github.jinahya.openfire.persistence.ibatis.type.Date015TypeHandler"/>
    <result column="ofMucRoom_canChangeSubject" property="canChangeSubject"/>
    <result column="ofMucRoom_maxUsers" property="maxUsers"/>
    <result column="ofMucRoom_publicRoom" property="publicRoom"/>
    <result column="ofMucRoom_moderated" property="moderated"/>
    <result column="ofMucRoom_membersOnly" property="membersOnly"/>
    <result column="ofMucRoom_canInvite" property="canInvite"/>
    <result column="ofMucRoom_roomPassword" property="roomPassword"/>
    <result column="ofMucRoom_canDiscoverJID" property="canDiscoverJid"/>
    <result column="ofMucRoom_logEnabled" property="logEnabled"/>
    <result column="ofMucRoom_subject" property="subject"/>
    <result column="ofMucRoom_rolesToBroadcast" property="rolesToBroadcast"/>
    <result column="ofMucRoom_useReservedNick" property="useReservedNick"/>
    <result column="ofMucRoom_canChangeNick" property="canChangeNick"/>
    <result column="ofMucRoom_canRegister" property="canRegister"/>
    <result column="ofMucRoom_allowpm" property="allowpm"/>
    <association column="ofMucRoom_serviceID" property="service"
                 columnPrefix="ofMucService_"
                 resultMap="com.github.jinahya.openfire.persistence.ibatis.mapper.OfMucServiceMapper.resultMap"/>
  </resultMap>

  <sql id="sqlColumns">
    ${alias}roomID           AS ${prefix}roomID,
    ${alias}creationDate     AS ${prefix}creationDate,
    ${alias}modificationDate AS ${prefix}modificationDate,
    ${alias}name             AS ${prefix}name,
    ${alias}naturalName      AS ${prefix}naturalName,
    ${alias}description      AS ${prefix}description,
    ${alias}lockedDate       AS ${prefix}lockedDate,
    ${alias}emptyDate        AS ${prefix}emptyDate,
    ${alias}canChangeSubject AS ${prefix}canChangeSubject,
    ${alias}maxUsers         AS ${prefix}maxUsers,
    ${alias}publicRoom       AS ${prefix}publicRoom,
    ${alias}moderated        AS ${prefix}moderated,
    ${alias}membersOnly      AS ${prefix}membersOnly,
    ${alias}canInvite        AS ${prefix}canInvite,
    ${alias}roomPassword     AS ${prefix}roomPassword,
    ${alias}canDiscoverJID   AS ${prefix}canDiscoverJID,
    ${alias}logEnabled       AS ${prefix}logEnabled,
    ${alias}subject          AS ${prefix}subject,
    ${alias}rolesToBroadcast AS ${prefix}rolesToBroadcast,
    ${alias}useReservedNick  AS ${prefix}useReservedNick,
    ${alias}canChangeNick    AS ${prefix}canChangeNick,
    ${alias}canRegister      AS ${prefix}canRegister,
    ${alias}allowpm          AS ${prefix}allowpm
  </sql>

  <select id="selectOne01" resultMap="resultMapAssociative" fetchSize="1">
    SELECT
    <include refid="sqlColumns">
      <property name="alias" value="ofMucRoom."/>
      <property name="prefix" value="ofMucRoom_"/>
    </include>
    ,
    <include refid="com.github.jinahya.openfire.persistence.ibatis.mapper.OfMucServiceMapper.sqlColumns">
      <property name="alias" value="ofMucService."/>
      <property name="prefix" value="ofMucService_"/>
    </include>
    FROM
    ${catalog}${schema}ofMucRoom AS ofMucRoom
    INNER JOIN ${catalog}${schema}ofMucService AS ofMucService
    ON ofMucRoom.serviceID = ofMucService.serviceID
    WHERE
    ofMucRoom.serviceID = #{serviceId} AND ofMucRoom.name = #{name}
  </select>

  <select id="selectList01" resultMap="resultMapAssociative">
    SELECT
    <include refid="sqlColumns">
      <property name="alias" value="ofMucRoom."/>
      <property name="prefix" value="ofMucRoom_"/>
    </include>
    ,
    <include refid="com.github.jinahya.openfire.persistence.ibatis.mapper.OfMucServiceMapper.sqlColumns">
      <property name="alias" value="ofMucService."/>
      <property name="prefix" value="ofMucService_"/>
    </include>
    FROM
    <include refid="com.github.jinahya.openfire.persistence.ibatis.mapper.OfMappedMapper.sqlTable">
      <property name="table" value="ofMucRoom"/>
    </include> AS ofMucRoom
    INNER JOIN
    <include refid="com.github.jinahya.openfire.persistence.ibatis.mapper.OfMappedMapper.sqlTable">
      <property name="table" value="ofMucService"/>
    </include> AS ofMucService
    ON ofMucRoom.serviceID = ofMucService.serviceID
    WHERE 1 = 1
    <if test="serviceId != null">
      AND ofMucRoom.serviceID = #{serviceId}
    </if>
    ORDER BY
    <choose>
      <when test="natural">
        <if test="serviceId == null">
          ofMucService.subdomain
          <include refid="com.github.jinahya.openfire.persistence.ibatis.mapper.OfMappedMapper.sqlAscending"/>
          ,
        </if>
        ofMucRoom.name
        <include refid="com.github.jinahya.openfire.persistence.ibatis.mapper.OfMappedMapper.sqlAscending"/>
      </when>
      <otherwise>
        <if test="serviceId == null">
          ofMucRoom.serviceID
          <include refid="com.github.jinahya.openfire.persistence.ibatis.mapper.OfMappedMapper.sqlAscending"/>
          ,
        </if>
        ofMucRoom.roomID
        <include refid="com.github.jinahya.openfire.persistence.ibatis.mapper.OfMappedMapper.sqlAscending"/>
      </otherwise>
    </choose>
  </select>

</mapper>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy