ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tony Qian" <daqiqi...@aol.com>
Subject Re: query by example
Date Wed, 22 Feb 2006 22:21:16 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title></title>
</head>
<body>
<font face="Arial,sans-serif"><font size="2">Jeff,<br>
<br>
Thanks for the prompt response. However, there is no method such as
setMileage() in the CarExample.java. If I have a query criterion with
range, for example car price from $5000 - 10000, how do I use
CarExample class to set it up?<br>
<br>
thanks,<br>
Tony<br>
<br>
<span type="cite">Jeff Butler wrote on 2/22/2006, 3:15 PM:</span>
</font></font>
<p><font face="Arial,sans-serif" size="2"></font></p>
<blockquote type="cite"  style="border-left: thin solid blue; padding-left: 10px; margin-left:
0pt;"><font  face="Arial,sans-serif" size="2"></font>
  <div><font face="Arial,sans-serif" size="2">Try this:</font></div>
  <font face="Arial,sans-serif" size="2"></font>
  <div><font face="Arial,sans-serif" size="2">&nbsp;</font></div>
  <font face="Arial,sans-serif" size="2"></font>
  <div><font face="Arial,sans-serif" size="2">CarExample ce = new
CarExample();</font></div>
  <font face="Arial,sans-serif" size="2"></font>
  <div><font face="Arial,sans-serif" size="2">ce.setMilage(50000);</font></div>
  <font face="Arial,sans-serif" size="2"></font>
  <div><font face="Arial,sans-serif" size="2">ce.setMilage_Indicator(CarExample.EXAMPLE_LESS_THAN);</font></div>
  <font face="Arial,sans-serif" size="2"></font>
  <div><font face="Arial,sans-serif" size="2">List list =
carDao.selectByExample(ce);<br>
&nbsp;</font></div>
  <font face="Arial,sans-serif" size="2"></font>
  <div><font face="Arial,sans-serif" size="2">Jeff Butler</font></div>
  <font face="Arial,sans-serif" size="2"></font>
  <div><font face="Arial,sans-serif" size="2"><br>
&nbsp;</font></div>
  <font face="Arial,sans-serif" size="2"></font>
  <div><font face="Arial,sans-serif" size="2"><span class="gmail_quote">On
2/22/06, <b class="gmail_sendername">Tony Qian</b> &lt;<a  href="mailto:daqiqian2@aol.com">daqiqian2@aol.com</a>&gt;
wrote:</span>
  </font>
  <blockquote class="gmail_quote"  style="border-left: 1px solid rgb(204, 204, 204); margin:
0px 0px 0px 0.8ex; padding-left: 1ex;"><font  face="Courier New" size="2">I just
downloaded abator and denegrated
xml, dao, and <br>
model codes. I can not figure out how to use query by <br>
example style selection. <br>
    <br>
Here is one method in dao. <br>
    <br>
&nbsp;&nbsp; /** <br>
&nbsp;&nbsp;&nbsp;&nbsp; * This method was generated by Abator for iBATIS.
<br>
&nbsp;&nbsp;&nbsp;&nbsp; * This method corresponds to the database table <br>
carproject.car <br>
&nbsp;&nbsp;&nbsp;&nbsp; * <br>
&nbsp;&nbsp;&nbsp;&nbsp; * @abatorgenerated Wed Feb 22 03:05:24 EST 2006 <br>
&nbsp;&nbsp;&nbsp;&nbsp; */ <br>
&nbsp;&nbsp;&nbsp; public List selectByExample(CarExample example) { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return selectByExample(example,
null); <br>
&nbsp;&nbsp;&nbsp; } <br>
    <br>
one of the methods in CarExample <br>
    <br>
&nbsp;&nbsp; /** <br>
&nbsp;&nbsp;&nbsp;&nbsp; * This method was generated by Abator for iBATIS.
<br>
&nbsp;&nbsp;&nbsp;&nbsp; * This method corresponds to the database table <br>
carproject.car <br>
&nbsp;&nbsp;&nbsp;&nbsp; * <br>
&nbsp;&nbsp;&nbsp;&nbsp; * @abatorgenerated Wed Feb 22 03:05:24 EST 2006 <br>
&nbsp;&nbsp;&nbsp;&nbsp; */ <br>
&nbsp;&nbsp;&nbsp; public void setMileage_Indicator(int <br>
mileage_Indicator) { <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; this.mileage_Indicator
= mileage_Indicator; <br>
&nbsp;&nbsp;&nbsp; } <br>
    <br>
Can someone give me some very brief code to select a car <br>
with mileage less than 50,000 miles? <br>
    <br>
Appreciate your help, <br>
    <span class="sg">Tony </span></font></blockquote>
  </div>
  <font face="Arial,sans-serif" size="2"><br>
  </font></blockquote>
</body>
</html>


Mime
View raw message