Commit 274acd4d authored by Eduardo Macarron's avatar Eduardo Macarron

upgraded to mybatis-spring 1.0.1 and stripes 1.5.6

parent 1a61bfe4
......@@ -10,14 +10,19 @@
<url>http://www.mybatis.org</url>
<dependencies>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.10</version>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.0.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>net.sourceforge.stripes</groupId>
<artifactId>stripes</artifactId>
<version>1.5.4</version>
<version>1.5.6</version>
<exclusions>
<exclusion>
<groupId>com.sun</groupId>
......@@ -55,21 +60,16 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
<dependency>
<groupId>cglib</groupId>
<artifactId>cglib</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>1.8.0.10</version>
</dependency>
</dependencies>
<build>
<finalName>jpetstore</finalName>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-config.dtd">
<configuration>
<typeAliases>
<typeAlias alias="account" type="org.mybatis.jpetstore.domain.Account" />
<typeAlias alias="category" type="org.mybatis.jpetstore.domain.Category" />
<typeAlias alias="item" type="org.mybatis.jpetstore.domain.Item" />
<typeAlias alias="lineItem" type="org.mybatis.jpetstore.domain.LineItem" />
<typeAlias alias="order" type="org.mybatis.jpetstore.domain.Order" />
<typeAlias alias="product" type="org.mybatis.jpetstore.domain.Product" />
<typeAlias alias="sequence" type="org.mybatis.jpetstore.domain.Sequence" />
</typeAliases>
</configuration>
......@@ -6,7 +6,7 @@
<cache />
<select id="getAccountByUsername" parameterType="string" resultType="account">
<select id="getAccountByUsername" parameterType="string" resultType="Account">
SELECT
SIGNON.USERNAME,
ACCOUNT.EMAIL,
......@@ -32,7 +32,7 @@
AND PROFILE.FAVCATEGORY = BANNERDATA.FAVCATEGORY
</select>
<select id="getAccountByUsernameAndPassword" parameterType="account" resultType="account">
<select id="getAccountByUsernameAndPassword" parameterType="Account" resultType="Account">
SELECT
SIGNON.USERNAME,
ACCOUNT.EMAIL,
......@@ -59,7 +59,7 @@
AND PROFILE.FAVCATEGORY = BANNERDATA.FAVCATEGORY
</select>
<update id="updateAccount" parameterType="account">
<update id="updateAccount" parameterType="Account">
UPDATE ACCOUNT SET
EMAIL = #{email},
FIRSTNAME = #{firstName},
......@@ -75,7 +75,7 @@
WHERE USERID = #{username}
</update>
<insert id="insertAccount" parameterType="account">
<insert id="insertAccount" parameterType="Account">
INSERT INTO ACCOUNT
(EMAIL, FIRSTNAME, LASTNAME, STATUS, ADDR1, ADDR2, CITY, STATE, ZIP, COUNTRY, PHONE, USERID)
VALUES
......@@ -84,7 +84,7 @@
<!--
TODO MyBatis 3 does not map booleans to integers
<update id="updateProfile" parameterType="account">
<update id="updateProfile" parameterType="Account">
UPDATE PROFILE SET
LANGPREF = #{languagePreference},
FAVCATEGORY = #{favouriteCategoryId},
......@@ -94,7 +94,7 @@
</update>
-->
<update id="updateProfile" parameterType="account">
<update id="updateProfile" parameterType="Account">
UPDATE PROFILE SET
LANGPREF = #{languagePreference},
FAVCATEGORY = #{favouriteCategoryId}
......@@ -103,23 +103,23 @@
<!--
TODO MyBatis 3 does not map booleans to integers
<insert id="insertProfile" parameterType="account">
<insert id="insertProfile" parameterType="Account">
INSERT INTO PROFILE (LANGPREF, FAVCATEGORY, MYLISTOPT, BANNEROPT, USERID)
VALUES (#{languagePreference}, #{favouriteCategoryId}, #{listOption}, #{bannerOption}, #{username})
</insert>
-->
<insert id="insertProfile" parameterType="account">
<insert id="insertProfile" parameterType="Account">
INSERT INTO PROFILE (LANGPREF, FAVCATEGORY, USERID)
VALUES (#{languagePreference}, #{favouriteCategoryId}, #{username})
</insert>
<update id="updateSignon" parameterType="account">
<update id="updateSignon" parameterType="Account">
UPDATE SIGNON SET PASSWORD = #{password}
WHERE USERNAME = #{username}
</update>
<insert id="insertSignon" parameterType="account">
<insert id="insertSignon" parameterType="Account">
INSERT INTO SIGNON (PASSWORD,USERNAME)
VALUES (#{password}, #{username})
</insert>
......
......@@ -6,7 +6,7 @@
<cache />
<select id="getCategory" parameterType="string" resultType="category">
<select id="getCategory" parameterType="string" resultType="Category">
SELECT
CATID AS categoryId,
NAME,
......@@ -15,7 +15,7 @@
WHERE CATID = #{categoryId}
</select>
<select id="getCategoryList" resultType="category">
<select id="getCategoryList" resultType="Category">
SELECT
CATID AS categoryId,
NAME,
......
......@@ -6,7 +6,7 @@
<cache />
<select id="getItemListByProduct" parameterType="string" resultType="item">
<select id="getItemListByProduct" parameterType="string" resultType="Item">
SELECT
I.ITEMID,
LISTPRICE,
......@@ -27,7 +27,7 @@
AND I.PRODUCTID = #{value}
</select>
<select id="getItem" parameterType="string" resultType="item">
<select id="getItem" parameterType="string" resultType="Item">
select
I.ITEMID,
LISTPRICE,
......
......@@ -6,7 +6,7 @@
<cache />
<select id="getLineItemsByOrderId" parameterType="int" resultType="lineItem">
<select id="getLineItemsByOrderId" parameterType="int" resultType="LineItem">
SELECT
ORDERID,
LINENUM AS lineNumber,
......@@ -17,7 +17,7 @@
WHERE ORDERID = #{orderId}
</select>
<insert id="insertLineItem" parameterType="lineItem">
<insert id="insertLineItem" parameterType="LineItem">
INSERT INTO LINEITEM (ORDERID, LINENUM, ITEMID, QUANTITY, UNITPRICE)
VALUES (#{orderId}, #{lineNumber}, #{itemId}, #{quantity}, #{unitPrice})
</insert>
......
......@@ -6,7 +6,7 @@
<cache />
<select id="getOrder" resultType="order" parameterType="int">
<select id="getOrder" resultType="Order" parameterType="int">
select
BILLADDR1 AS billAddress1,
BILLADDR2 AS billAddress2,
......@@ -39,7 +39,7 @@
AND ORDERS.ORDERID = ORDERSTATUS.ORDERID
</select>
<select id="getOrdersByUsername" parameterType="string" resultType="order">
<select id="getOrdersByUsername" parameterType="string" resultType="Order">
SELECT
BILLADDR1 AS billAddress1,
BILLADDR2 AS billAddress2,
......@@ -73,7 +73,7 @@
ORDER BY ORDERDATE
</select>
<insert id="insertOrder" parameterType="order">
<insert id="insertOrder" parameterType="Order">
INSERT INTO ORDERS (ORDERID, USERID, ORDERDATE, SHIPADDR1, SHIPADDR2, SHIPCITY, SHIPSTATE,
SHIPZIP, SHIPCOUNTRY, BILLADDR1, BILLADDR2, BILLCITY, BILLSTATE, BILLZIP, BILLCOUNTRY,
COURIER, TOTALPRICE, BILLTOFIRSTNAME, BILLTOLASTNAME, SHIPTOFIRSTNAME, SHIPTOLASTNAME,
......@@ -84,7 +84,7 @@
#{shipToFirstName}, #{shipToLastName}, #{creditCard}, #{expiryDate}, #{cardType}, #{locale})
</insert>
<insert id="insertOrderStatus" parameterType="order">
<insert id="insertOrderStatus" parameterType="Order">
INSERT INTO ORDERSTATUS (ORDERID, LINENUM, TIMESTAMP, STATUS)
VALUES (#{orderId,jdbcType=NUMERIC}, #{orderId,jdbcType=NUMERIC}, #{orderDate,jdbcType=TIMESTAMP}, #{status,jdbcType=VARCHAR})
</insert>
......
......@@ -6,7 +6,7 @@
<cache />
<select id="getProduct" parameterType="string" resultType="product">
<select id="getProduct" parameterType="string" resultType="Product">
SELECT
PRODUCTID,
NAME,
......@@ -16,7 +16,7 @@
WHERE PRODUCTID = #{productId}
</select>
<select id="getProductListByCategory" parameterType="string" resultType="product">
<select id="getProductListByCategory" parameterType="string" resultType="Product">
SELECT
PRODUCTID,
NAME,
......@@ -26,7 +26,7 @@
WHERE CATEGORY = #{value}
</select>
<select id="searchProductList" parameterType="string" resultType="product">
<select id="searchProductList" parameterType="string" resultType="Product">
select
PRODUCTID,
NAME,
......
......@@ -6,13 +6,13 @@
<cache />
<select id="getSequence" parameterType="sequence" resultType="sequence">
<select id="getSequence" parameterType="Sequence" resultType="Sequence">
SELECT name, nextid
FROM SEQUENCE
WHERE NAME = #{name}
</select>
<update id="updateSequence" parameterType="sequence">
<update id="updateSequence" parameterType="Sequence">
UPDATE SEQUENCE
SET NEXTID = #{nextId}
WHERE NAME = #{name}
......
......@@ -51,7 +51,7 @@
<!-- define the SqlSessionFactory -->
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="configLocation" value="classpath:mybatis-config.xml" />
<property name="typeAliasesPackage" value="org.mybatis.jpetstore.domain" />
</bean>
<!-- scan for mappers and let them be autowired -->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment