I am developing a opensource eclipse plugin for support ORM.
The main just include:
 
  • Database modeler: visualization entity and generate ddl. (Under Beta)
  • OJB,generate Ojb configuration xml and java code. (Under Test)
  • Hibernate,generate Hibernate configuration xml and java code. (Under Test)
  • IBatis,,generate IBatis configuration xml and java code. (Under Test)
  • Web CRUD:including Wicket(I like it).Struts,Tapestry. (Under Develop)
The attachment is the xml files g enerated by this plugin.
I need more suggestions before i beign to release milestone version.
 
Addtionally:
At first i want to located in sourceforge.But i am lived in china.
The speed is not good enough.
So i still try to find one location.
Any suggestions are welcome.


雅虎1G免费邮箱百分百防垃圾信
雅虎助手-搜索、杀毒、防骚扰
				
<!DOCTYPE sqlMapConfig PUBLIC "-//ibatis.apache.org//DTD SQL Map Config 2.0//EN"
    "http://ibatis.apache.org/dtd/sql-map-config-2.dtd";>
    
				
			<sqlMapConfig>
	<settings cacheModelsEnabled="true" lazyLoadingEnabled="true" maxRequests="32" maxSessions="10" maxTransactions="5" useStatementNamespaces="true"/>
	<transactionManager type="JDBC">
		<dataSource type="SIMPLE">
			<property name="Pool.PingQuery" value="select * from dual"/>
			<property name="JDBC.DefaultAutoCommit" value="true"/>
			<property name="JDBC.Password" value="kingdom"/>
			<property name="JDBC.ConnectionURL" value="jdbc:mysql://localhost/demo"/>
			<property name="JDBC.Driver" value="com.mysql.jdbc.Driver"/>
			<property name="JDBC.Username" value="root"/>
			<property name="Pool.PingEnabled" value="false"/>
		</dataSource>
	</transactionManager>
	<sqlMap resource="resource.xml"/>
	<sqlMap resource="ibatis\role.xml"/>
	<sqlMap resource="ibatis\userrole.xml"/>
	<sqlMap resource="ibatis\user.xml"/>
</sqlMapConfig>
				
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
    "http://ibatis.apache.org/dtd/sql-map-2.dtd";>
    
				
			<sqlMap>
	<typeAlias alias="userRole" type="ibatis.UserRole"/>
	<typeAlias alias="user" type="ibatis.User"/>
	<typeAlias alias="role" type="ibatis.Role"/>
	<resultMap class="role" id="roleResult">
		<result column="ROLE_ID" property="roleId"/>
		<result column="ROLE_NAME" property="roleName"/>
		<result column="ROLE_MEMO" property="roleMemo"/>
		<result column="ROLE_ID" property="userRoles" select="getUserRolesByRole"/>
	</resultMap>
	<resultMap class="userRole" id="userRoleResult">
		<result column="USER_ID" property="userId"/>
		<result column="ROLE_ID" property="roleId"/>
		<result column="ROLE_ID" property="role" select="getRoleByUserRole"/>
		<result column="USER_ID" property="user" select="getUserByUserRole"/>
	</resultMap>
	<resultMap class="user" id="userResult">
		<result column="USER_ID" property="userId"/>
		<result column="USER_NAME" property="userName"/>
		<result column="PHOTO" property="photo"/>
		<result column="USER_MEMO" property="userMemo"/>
		<result column="USER_ID" property="userRoles" select="getUserRolesByUser"/>
	</resultMap>
</sqlMap>
				
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
    "http://ibatis.apache.org/dtd/sql-map-2.dtd";>
    
				
			<sqlMap>
	<sql id="selectUserWhere">
		<dynamic prepend="where">
			<isPropertyAvailable prepend="and" property="user_And_Equal_UserId"><![CDATA[USER_ID=#userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_Equal_UserId"><![CDATA[USER_ID=#userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_NotEqual_UserId"><![CDATA[USER_ID<>#userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_NotEqual_UserId"><![CDATA[USER_ID<>#userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_Greater_UserId"><![CDATA[USER_ID > #userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_Greater_UserId"><![CDATA[USER_ID > #userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_GreaterEqual_UserId"><![CDATA[USER_ID >= #userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_GreaterEqual_UserId"><![CDATA[USER_ID >= #userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_Less_UserId"><![CDATA[USER_ID < #userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_Less_UserId"><![CDATA[USER_ID < #userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_LessEqual_UserId"><![CDATA[USER_ID <= #userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_LessEqual_UserId"><![CDATA[USER_ID <= #userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_Null_UserId"><![CDATA[USER_ID is null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_Null_UserId"><![CDATA[USER_ID is null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_NotNull_UserId"><![CDATA[USER_ID is not null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_NotNull_UserId"><![CDATA[USER_ID is not null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_Equal_UserName"><![CDATA[USER_NAME=#userName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_Equal_UserName"><![CDATA[USER_NAME=#userName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_NotEqual_UserName"><![CDATA[USER_NAME<>#userName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_NotEqual_UserName"><![CDATA[USER_NAME<>#userName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_Greater_UserName"><![CDATA[USER_NAME > #userName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_Greater_UserName"><![CDATA[USER_NAME > #userName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_GreaterEqual_UserName"><![CDATA[USER_NAME >= #userName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_GreaterEqual_UserName"><![CDATA[USER_NAME >= #userName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_Less_UserName"><![CDATA[USER_NAME < #userName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_Less_UserName"><![CDATA[USER_NAME < #userName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_LessEqual_UserName"><![CDATA[USER_NAME <= #userName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_LessEqual_UserName"><![CDATA[USER_NAME <= #userName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_Like_UserName"><![CDATA[USER_NAME Like #userName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_Like_UserName"><![CDATA[USER_NAME Like #userName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_NotLike_UserName"><![CDATA[USER_NAME Not Like #userName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_NotLike_UserName"><![CDATA[USER_NAME Not Like #userName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_Null_UserName"><![CDATA[USER_NAME is null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_Null_UserName"><![CDATA[USER_NAME is null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_NotNull_UserName"><![CDATA[USER_NAME is not null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_NotNull_UserName"><![CDATA[USER_NAME is not null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_Equal_UserMemo"><![CDATA[USER_MEMO=#userMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_Equal_UserMemo"><![CDATA[USER_MEMO=#userMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_NotEqual_UserMemo"><![CDATA[USER_MEMO<>#userMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_NotEqual_UserMemo"><![CDATA[USER_MEMO<>#userMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_Greater_UserMemo"><![CDATA[USER_MEMO > #userMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_Greater_UserMemo"><![CDATA[USER_MEMO > #userMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_GreaterEqual_UserMemo"><![CDATA[USER_MEMO >= #userMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_GreaterEqual_UserMemo"><![CDATA[USER_MEMO >= #userMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_Less_UserMemo"><![CDATA[USER_MEMO < #userMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_Less_UserMemo"><![CDATA[USER_MEMO < #userMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_LessEqual_UserMemo"><![CDATA[USER_MEMO <= #userMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_LessEqual_UserMemo"><![CDATA[USER_MEMO <= #userMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_Like_UserMemo"><![CDATA[USER_MEMO Like #userMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_Like_UserMemo"><![CDATA[USER_MEMO Like #userMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_NotLike_UserMemo"><![CDATA[USER_MEMO Not Like #userMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_NotLike_UserMemo"><![CDATA[USER_MEMO Not Like #userMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_Null_UserMemo"><![CDATA[USER_MEMO is null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_Null_UserMemo"><![CDATA[USER_MEMO is null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="user_And_NotNull_UserMemo"><![CDATA[USER_MEMO is not null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="user_Or_NotNull_UserMemo"><![CDATA[USER_MEMO is not null]]>

			</isPropertyAvailable>

		</dynamic>

	</sql>
	<select id="selectUser" parameterClass="java.util.Map" resultMap="userResult"><![CDATA[
 Select  USER_ID, USER_NAME, PHOTO, USER_MEMO from DEMO.USER_T 
 
]]>
		<include refid="selectUserWhere"/>

	</select>
	<select id="doSelectUser" parameterClass="java.util.Map" resultMap="userResult"><![CDATA[
 Select  USER_ID, USER_NAME, PHOTO, USER_MEMO from DEMO.USER_T 
 
 $Where$ $condition$]]>

	</select>
	<select id="doCountUser" parameterClass="java.util.Map" resultClass="int"><![CDATA[
 Select count(*) From DEMO.USER_T
 $Where$ $condition$]]>

	</select>
	<update id="updateUser" parameterClass="user"><![CDATA[
 Update DEMO.USER_T SET  USER_ID=#userId# ,  USER_NAME=#userName# ,  PHOTO=#photo# ,  USER_MEMO=#userMemo# Where USER_ID=#userId# 
]]>

	</update>
	<select id="selectUserByID" parameterClass="int" resultMap="userResult"><![CDATA[
 Select  USER_ID, USER_NAME, PHOTO, USER_MEMO from DEMO.USER_T 
 Where USER_ID=#userId# 
]]>

	</select>
	<select id="getUserRolesByUser" parameterClass="int" resultMap="userRoleResult"><![CDATA[
 Select  USER_ID, ROLE_ID from DEMO.USER_ROLE 
 
 Where USER_ID=#userId#
]]>

	</select>
	<select id="doDeleteUser" parameterClass="java.util.Map"><![CDATA[
 Delete From DEMO.USER_T
 $Where$ $condition$]]>

	</select>
	<insert id="insertUser" parameterClass="user"><![CDATA[
 Insert Into DEMO.USER_T(USER_ID , USER_NAME , PHOTO , USER_MEMO) 
 Values(#userId# , #userName# , #photo# , #userMemo#) 
]]>
		<selectKey keyProperty="userId" resultClass="int"><![CDATA[SELECT LAST_INSERT_ID() AS USER_ID]]>

		</selectKey>

	</insert>
	<delete id="deleteUser" parameterClass="int"><![CDATA[
 Delete From DEMO.USER_T
 Where USER_ID=#userId# 
]]>

	</delete>
	<delete id="deleteUserByID" parameterClass="int"><![CDATA[
 Delete From DEMO.USER_T
]]>
		<include refid="selectUserWhere"/>

	</delete>
</sqlMap>
				
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
    "http://ibatis.apache.org/dtd/sql-map-2.dtd";>
    
				
			<sqlMap>
	<sql id="selectRoleWhere">
		<dynamic prepend="where">
			<isPropertyAvailable prepend="and" property="role_And_Equal_RoleId"><![CDATA[ROLE_ID=#roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_Equal_RoleId"><![CDATA[ROLE_ID=#roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_NotEqual_RoleId"><![CDATA[ROLE_ID<>#roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_NotEqual_RoleId"><![CDATA[ROLE_ID<>#roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_Greater_RoleId"><![CDATA[ROLE_ID > #roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_Greater_RoleId"><![CDATA[ROLE_ID > #roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_GreaterEqual_RoleId"><![CDATA[ROLE_ID >= #roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_GreaterEqual_RoleId"><![CDATA[ROLE_ID >= #roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_Less_RoleId"><![CDATA[ROLE_ID < #roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_Less_RoleId"><![CDATA[ROLE_ID < #roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_LessEqual_RoleId"><![CDATA[ROLE_ID <= #roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_LessEqual_RoleId"><![CDATA[ROLE_ID <= #roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_Null_RoleId"><![CDATA[ROLE_ID is null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_Null_RoleId"><![CDATA[ROLE_ID is null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_NotNull_RoleId"><![CDATA[ROLE_ID is not null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_NotNull_RoleId"><![CDATA[ROLE_ID is not null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_Equal_RoleName"><![CDATA[ROLE_NAME=#roleName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_Equal_RoleName"><![CDATA[ROLE_NAME=#roleName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_NotEqual_RoleName"><![CDATA[ROLE_NAME<>#roleName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_NotEqual_RoleName"><![CDATA[ROLE_NAME<>#roleName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_Greater_RoleName"><![CDATA[ROLE_NAME > #roleName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_Greater_RoleName"><![CDATA[ROLE_NAME > #roleName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_GreaterEqual_RoleName"><![CDATA[ROLE_NAME >= #roleName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_GreaterEqual_RoleName"><![CDATA[ROLE_NAME >= #roleName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_Less_RoleName"><![CDATA[ROLE_NAME < #roleName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_Less_RoleName"><![CDATA[ROLE_NAME < #roleName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_LessEqual_RoleName"><![CDATA[ROLE_NAME <= #roleName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_LessEqual_RoleName"><![CDATA[ROLE_NAME <= #roleName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_Like_RoleName"><![CDATA[ROLE_NAME Like #roleName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_Like_RoleName"><![CDATA[ROLE_NAME Like #roleName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_NotLike_RoleName"><![CDATA[ROLE_NAME Not Like #roleName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_NotLike_RoleName"><![CDATA[ROLE_NAME Not Like #roleName#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_Null_RoleName"><![CDATA[ROLE_NAME is null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_Null_RoleName"><![CDATA[ROLE_NAME is null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_NotNull_RoleName"><![CDATA[ROLE_NAME is not null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_NotNull_RoleName"><![CDATA[ROLE_NAME is not null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_Equal_RoleMemo"><![CDATA[ROLE_MEMO=#roleMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_Equal_RoleMemo"><![CDATA[ROLE_MEMO=#roleMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_NotEqual_RoleMemo"><![CDATA[ROLE_MEMO<>#roleMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_NotEqual_RoleMemo"><![CDATA[ROLE_MEMO<>#roleMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_Greater_RoleMemo"><![CDATA[ROLE_MEMO > #roleMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_Greater_RoleMemo"><![CDATA[ROLE_MEMO > #roleMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_GreaterEqual_RoleMemo"><![CDATA[ROLE_MEMO >= #roleMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_GreaterEqual_RoleMemo"><![CDATA[ROLE_MEMO >= #roleMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_Less_RoleMemo"><![CDATA[ROLE_MEMO < #roleMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_Less_RoleMemo"><![CDATA[ROLE_MEMO < #roleMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_LessEqual_RoleMemo"><![CDATA[ROLE_MEMO <= #roleMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_LessEqual_RoleMemo"><![CDATA[ROLE_MEMO <= #roleMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_Like_RoleMemo"><![CDATA[ROLE_MEMO Like #roleMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_Like_RoleMemo"><![CDATA[ROLE_MEMO Like #roleMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_NotLike_RoleMemo"><![CDATA[ROLE_MEMO Not Like #roleMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_NotLike_RoleMemo"><![CDATA[ROLE_MEMO Not Like #roleMemo#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_Null_RoleMemo"><![CDATA[ROLE_MEMO is null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_Null_RoleMemo"><![CDATA[ROLE_MEMO is null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="role_And_NotNull_RoleMemo"><![CDATA[ROLE_MEMO is not null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="role_Or_NotNull_RoleMemo"><![CDATA[ROLE_MEMO is not null]]>

			</isPropertyAvailable>

		</dynamic>

	</sql>
	<update id="updateRole" parameterClass="role"><![CDATA[
 Update DEMO.ROLE_T SET  ROLE_ID=#roleId# ,  ROLE_NAME=#roleName# ,  ROLE_MEMO=#roleMemo# Where ROLE_ID=#roleId# 
]]>

	</update>
	<select id="getUserRolesByRole" parameterClass="int" resultMap="userRoleResult"><![CDATA[
 Select  USER_ID, ROLE_ID from DEMO.USER_ROLE 
 
 Where ROLE_ID=#roleId#
]]>

	</select>
	<select id="doDeleteRole" parameterClass="java.util.Map"><![CDATA[
 Delete From DEMO.ROLE_T
 $Where$ $condition$]]>

	</select>
	<select id="selectRole" parameterClass="java.util.Map" resultMap="roleResult"><![CDATA[
 Select  ROLE_ID, ROLE_NAME, ROLE_MEMO from DEMO.ROLE_T 
 
]]>
		<include refid="selectRoleWhere"/>

	</select>
	<delete id="deleteRole" parameterClass="int"><![CDATA[
 Delete From DEMO.ROLE_T
 Where ROLE_ID=#roleId# 
]]>

	</delete>
	<insert id="insertRole" parameterClass="role"><![CDATA[
 Insert Into DEMO.ROLE_T(ROLE_ID , ROLE_NAME , ROLE_MEMO) 
 Values(#roleId# , #roleName# , #roleMemo#) 
]]>
		<selectKey keyProperty="roleId" resultClass="int"><![CDATA[SELECT LAST_INSERT_ID() AS ROLE_ID]]>

		</selectKey>

	</insert>
	<select id="doSelectRole" parameterClass="java.util.Map" resultMap="roleResult"><![CDATA[
 Select  ROLE_ID, ROLE_NAME, ROLE_MEMO from DEMO.ROLE_T 
 
 $Where$ $condition$]]>

	</select>
	<select id="doCountRole" parameterClass="java.util.Map" resultClass="int"><![CDATA[
 Select count(*) From DEMO.ROLE_T
 $Where$ $condition$]]>

	</select>
	<delete id="deleteRoleByID" parameterClass="int"><![CDATA[
 Delete From DEMO.ROLE_T
]]>
		<include refid="selectRoleWhere"/>

	</delete>
	<select id="selectRoleByID" parameterClass="int" resultMap="roleResult"><![CDATA[
 Select  ROLE_ID, ROLE_NAME, ROLE_MEMO from DEMO.ROLE_T 
 Where ROLE_ID=#roleId# 
]]>

	</select>
</sqlMap>
				
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
    "http://ibatis.apache.org/dtd/sql-map-2.dtd";>
    
				
			<sqlMap>
	<sql id="selectUserRoleWhere">
		<dynamic prepend="where">
			<isPropertyAvailable prepend="and" property="userRole_And_Equal_UserId"><![CDATA[USER_ID=#userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="userRole_Or_Equal_UserId"><![CDATA[USER_ID=#userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="userRole_And_NotEqual_UserId"><![CDATA[USER_ID<>#userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="userRole_Or_NotEqual_UserId"><![CDATA[USER_ID<>#userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="userRole_And_Greater_UserId"><![CDATA[USER_ID > #userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="userRole_Or_Greater_UserId"><![CDATA[USER_ID > #userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="userRole_And_GreaterEqual_UserId"><![CDATA[USER_ID >= #userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="userRole_Or_GreaterEqual_UserId"><![CDATA[USER_ID >= #userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="userRole_And_Less_UserId"><![CDATA[USER_ID < #userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="userRole_Or_Less_UserId"><![CDATA[USER_ID < #userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="userRole_And_LessEqual_UserId"><![CDATA[USER_ID <= #userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="userRole_Or_LessEqual_UserId"><![CDATA[USER_ID <= #userId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="userRole_And_Null_UserId"><![CDATA[USER_ID is null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="userRole_Or_Null_UserId"><![CDATA[USER_ID is null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="userRole_And_NotNull_UserId"><![CDATA[USER_ID is not null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="userRole_Or_NotNull_UserId"><![CDATA[USER_ID is not null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="userRole_And_Equal_RoleId"><![CDATA[ROLE_ID=#roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="userRole_Or_Equal_RoleId"><![CDATA[ROLE_ID=#roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="userRole_And_NotEqual_RoleId"><![CDATA[ROLE_ID<>#roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="userRole_Or_NotEqual_RoleId"><![CDATA[ROLE_ID<>#roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="userRole_And_Greater_RoleId"><![CDATA[ROLE_ID > #roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="userRole_Or_Greater_RoleId"><![CDATA[ROLE_ID > #roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="userRole_And_GreaterEqual_RoleId"><![CDATA[ROLE_ID >= #roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="userRole_Or_GreaterEqual_RoleId"><![CDATA[ROLE_ID >= #roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="userRole_And_Less_RoleId"><![CDATA[ROLE_ID < #roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="userRole_Or_Less_RoleId"><![CDATA[ROLE_ID < #roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="userRole_And_LessEqual_RoleId"><![CDATA[ROLE_ID <= #roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="userRole_Or_LessEqual_RoleId"><![CDATA[ROLE_ID <= #roleId#]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="userRole_And_Null_RoleId"><![CDATA[ROLE_ID is null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="userRole_Or_Null_RoleId"><![CDATA[ROLE_ID is null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="and" property="userRole_And_NotNull_RoleId"><![CDATA[ROLE_ID is not null]]>

			</isPropertyAvailable>
			<isPropertyAvailable prepend="or" property="userRole_Or_NotNull_RoleId"><![CDATA[ROLE_ID is not null]]>

			</isPropertyAvailable>

		</dynamic>

	</sql>
	<update id="updateUserRole" parameterClass="userRole"><![CDATA[
 Update DEMO.USER_ROLE SET  USER_ID=#userId# ,  ROLE_ID=#roleId# Where USER_ID=#userId#  AND ROLE_ID=#roleId# 
]]>

	</update>
	<select id="selectUserRole" parameterClass="java.util.Map" resultMap="userRoleResult"><![CDATA[
 Select  USER_ID, ROLE_ID from DEMO.USER_ROLE 
 
]]>
		<include refid="selectUserRoleWhere"/>

	</select>
	<select id="selectUserRoleByID" parameterClass="java.util.Map" resultMap="userRoleResult"><![CDATA[
 Select  USER_ID, ROLE_ID from DEMO.USER_ROLE 
 Where USER_ID=#userId#  AND ROLE_ID=#roleId# 
]]>

	</select>
	<select id="getRoleByUserRole" parameterClass="int" resultMap="roleResult"><![CDATA[
 Select  ROLE_ID, ROLE_NAME, ROLE_MEMO from DEMO.ROLE_T 
 
 Where ROLE_ID=#roleId#
]]>

	</select>
	<select id="doCountUserRole" parameterClass="java.util.Map" resultClass="int"><![CDATA[
 Select count(*) From DEMO.USER_ROLE
 $Where$ $condition$]]>

	</select>
	<delete id="deleteUserRoleByID" parameterClass="java.util.Map"><![CDATA[
 Delete From DEMO.USER_ROLE
]]>
		<include refid="selectUserRoleWhere"/>

	</delete>
	<delete id="deleteUserRole" parameterClass="java.util.Map"><![CDATA[
 Delete From DEMO.USER_ROLE
 Where USER_ID=#userId#  AND ROLE_ID=#roleId# 
]]>

	</delete>
	<select id="doSelectUserRole" parameterClass="java.util.Map" resultMap="userRoleResult"><![CDATA[
 Select  USER_ID, ROLE_ID from DEMO.USER_ROLE 
 
 $Where$ $condition$]]>

	</select>
	<select id="getUserByUserRole" parameterClass="int" resultMap="userResult"><![CDATA[
 Select  USER_ID, USER_NAME, PHOTO, USER_MEMO from DEMO.USER_T 
 
 Where USER_ID=#userId#
]]>

	</select>
	<insert id="insertUserRole" parameterClass="userRole"><![CDATA[
 Insert Into DEMO.USER_ROLE(USER_ID , ROLE_ID) 
 Values(#userId# , #roleId#) 
]]>

	</insert>
	<select id="doDeleteUserRole" parameterClass="java.util.Map"><![CDATA[
 Delete From DEMO.USER_ROLE
 $Where$ $condition$]]>

	</select>
</sqlMap>

Reply via email to