alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Spring Framework example source code file (Product.xml)

This example Spring Framework source code file (Product.xml) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Spring Framework tags/keywords

doctype, map, memory, or, or, product, public, sql, sql, utf-8, utf-8, weak, weak

The Spring Framework Product.xml source code

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">

<sqlMap namespace="Product">

  <cacheModel id="oneDayProduct" type="MEMORY">
    <flushInterval hours="24"/>
    <property name="reference-type" value="WEAK"/>
  </cacheModel>

  <resultMap id="result" class="org.springframework.samples.jpetstore.domain.Product">
    <result property="productId" column="productid" columnIndex="1"/>
    <result property="name" column="name" columnIndex="2"/>
    <result property="description" column="descn" columnIndex="3"/>
    <result property="categoryId" column="category" columnIndex="4"/>
  </resultMap>

  <select id="getProduct" resultMap="result">
    select productid, name, descn, category from product where productid = #value#
  </select>

  <select id="getProductListByCategory" resultMap="result">
    select productid, name, descn, category from product where category = #value#
  </select>

  <select id="searchProductList" resultMap="result">
    select productid, name, descn, category from product
    <dynamic prepend="where">
      <iterate property="keywordList" open="(" close=")" conjunction="OR">
        lower(name) like #keywordList[]# OR lower(category) like #keywordList[]# OR lower(descn) like #keywordList[]#
      </iterate>
    </dynamic>
  </select>

</sqlMap>

Other Spring Framework examples (source code examples)

Here is a short list of links related to this Spring Framework Product.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.