In Ormlite write case insensitive

In Ormlite, is it possible to make a case insensitive query without writing the actual SQL?

For example, if I search

the column name is “AccountName” and the column query, I would like to get the results for all “Finance”, “fInance”, “FINANCE”, etc., if I search for “finance”.

I was wondering if there is functional support for this or if I need to write SQL for it.

Thanks!

+4
source share
2 answers

I answer my question, but it seems to work.

newDao.query(newDao.queryBuilder().where().like("nameColumn", "finance") .prepare()) 

Above it seems that all are "finance", "finance", "FINANCE" or any other options.

+17
source

Right now (May 2011) there is no mechanism for this with ORMLite, except for writing real SQL and using queryRaw() and other raw methods.

In many MySQL databases, for example, case insensitivity appears by default . But this does not apply to Postgresql and Oracle .

A quick look at various database implementations shows that this is not a very easy and portable way to do this. Am I mistaken?

+1
source

All Articles