-
Hi all,
I want to know if there is any way on how to do 'smart' queries on a database...
Eg: Suppose I have a database of cars of color dark blue, and plain blue. If i give query of black, then it should result in cars of dark blue in the top of results (as dark blue and black are somewhat close visually speaking).
I also want to do this through EJB (2.0) and hence, EJBQL, so I want to know how it will affect my design..
Plz point me in the right direction..
Thanks in advance!
-
for sure, I would not use EJB 2.0. have you checked out the newest spec - EJB 3.0 ?
-
How is your database table design..Do you have a column called "Colour" and you store the records for "Dark Blue" and "Plain Blue" color cars as 2 different records.
If yes, then how can you expect the Query to give you "Dark Blue", if your query has "Dark Blue" in its predicate?
-
I would not recommend putting such logic at EJB layer. Writinng it at DB level (stored procs) is much better.