hi ajitesh,
imo this is a rather old javadoc :(
the current one is like this:
/**
* Adds and equals (=) criteria,
* customer_id = 10034
*
* @param attribute The field name to be used
* @param value An object representing the value of the field
*/
you'd better use addLike.
jakob
Ajitesh Das schrieb:
Is this a bug? Or I am missing something
The following tests are failing:
Here is my snippet of repository xml:
<field-descriptor id="3"
name="user"
column="USR"
jdbc-type="VARCHAR"
primarykey="false"
nullable="true"
indexed="false"
autoincrement="false"
locking="false"
default-fetch="false"
/>
I have table, "person" that contains a list of users : {user1,
user2,...., user10,new0,new1,.....,new100}
In code I am using :
myCriteria.addEqualTo("user","user*");
QueryByCriretia qc = new QueryByCriteria((com.acme.Person)obj,
myCriteria);
PB.getObjectByQuery(qc);
This returns an empty collection, whereas I am expecting that it should
return {user1,...,user10}
The Javadoc says that:
http://objectbridge.sourceforge.net/javadoc/index.html
"
addEqualTo
-------------
public void addEqualTo(java.lang.String attribute,
java.lang.Object value)Adds and equals (=)
criteria, customer_id = 10034
Where Value is a string simple pattern matching can be used, the
character * is a wildcard, e.g. customer_name = Ander*
Would match the customers: Anderson and Anderton. The character ?
matches a single occurence of a character. The '\' character is used as
an escape character and allow searching for strings containing * or ?.
So in order to search for Ander* - use Ander\*.
Parameters:
attribute - The field name to be used
value - An object representing the value of the field
"
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]