Thanks for "... Criteria.CUSTOM..." Scott !!!

after your help my BIG SELECT looking as:
...
Criteria.Criterion contentSearch = crit.getNewCriterion(ContentsPeer.TABLE_NAME, "contains(CONTENT,'%"+searchForBLOB+"%') > 0", Criteria.CUSTOM);
contentSearch.setTable(ContentsPeer.TABLE_NAME);
// Search in Title (Oracle.VARCHAR2)
Criteria.Criterion documentSearch = crit.getNewCriterion(DocumentsPeer.TITLE, (Object) ("%"+searchForBLOB+"%"), Criteria.LIKE);
// Union
crit.add(contentSearch.or(documentSearch));
...
and excellent WORKING !!!
THANKS!!!!


Vladimir Figurov wrote:


Hello! I use Oracle 9i and try use Text Search in BLOB field. A simple Oracle code for text search is "SELECT ... FROM table_content WHERE contains(blob_field, 'search_string')>0


How to build Criteria? Criteria crit = new Criteria(ContentsPeer.DATABASE_NAME); crit.add(ContentsPeer.TABLE_NAME, "contains(CONTENT,'%five%')", new Integer(0), Criteria.GREATER_THAN); returned a BAD Criterion : crit.toString() : SELECT FROM contents WHERE contents.contains(CONTENT,'%five%')>0 and Oracle is not understand this Select ;-((


Have you tried Criteria.CUSTOM - there is an example at http://db.apache.org/torque/criteria-howto.html


Scott

--



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to