I have a table (Mydata) with a String field called "index". This is NOT the PK for the table, but it nonetheless unique throughout the entire table.
The "index" field holds Strings such as "000" or "000000" or "034" or "01000", etc.
I have a finder as follows: java.util.Collection findByIndex(java.lang.String s)
The EJB-QL is defined as such: SELECT Object(m) FROM Mydata m WHERE m.index = ?1
Instead of retrieving the single, unique record that I am expecting, the finder returns all records that are like the one I am searching for.
So if I do a findByIndex("000"), it doesnt return a Collection with the single record, but a few similar ones, such as "000", "0000", "00000", "000000", etc.
I tried using the DISTINCT keyword, but that didnt help.
Please suggest some solution,
Im using 3.0.4.
I think this may be a bug, it is doing a "LIKE" rather than an exact match.