ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jesid <javav...@gmail.com>
Subject mutiple parameters in query
Date Thu, 21 Aug 2008 23:17:11 GMT

I need know how send the parameters to query if the query have more than 1
table, for example:

<select id="getCar" resultClass="co.enti.Car">
   SELECT
       car.COD_CAR as cod,
       per.NAME as name
   FROM
       IPS_CARA car,
       IPS_PERSON per
   WHERE
       car.COD_CAR = #cod# AND
       per.NAME like '%$name$%'
</select>


I´m sending the parameters this way



Car car = (Car) sqlMap.queryForObject("getCar", ???????);   ---- > here is
that I need help


and the bean from the table IPS_CARA, Car is for example:

public class Car {
     private String model;
   private int cod;
   private int codPer;

   public int getCodPer() {
       return codPer;
   }
   public void setCodPer(int codPer) {
       this.codPer = codPer;
   }

   public int getCod() {
       return cod;
   }
   public void setCod(int cod) {
       this.cod = cod;
   }

   public int getModel() {
       return model;
   }
   public void setModel(int model) {
       this.model = model;
   }

}

and IPS_PERSON is

public class Person {
     private String name;
   private String lastName;
   private int codPer;

   public int getCodPer() {
       return codPer;
   }
   public void setCodPer(int codPer) {
       this.codPer = codPer;
   }

   public String getName() {
       return cod;
   }
   public void setName(String name) {
       this.name = name;
   }

   public String getLastName() {
       return lastName;
   }
   public void setLastName(String lastName) {
       this.lastName = lastName;
   }

}

thank....:handshake:
-- 
View this message in context: http://www.nabble.com/mutiple-parameters-in-query-tp19098786p19098786.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Mime
View raw message