cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

About FlexibleSearchUtils.buildOracleCompatibleCollectionStatement

Former Member
0 Kudos
175

I've stumble upon this method FlexibleSearchUtils.buildOracleCompatibleCollectionStatement.

I guess that if I want to use an Oracle DB I would probably want to use this method while creating my flexible searches.

Now I wonder if we want the application code to be DB dependant. In hybris we usually don't have issue working with different DB. For instance during develoment, HSQLDB will be probably used whereas in production it won't be used. (Anyway this is a discutable topic, I prefer to develop with the target DB)

To go back to the initial subject, to make my application less DB depedant I certainly want to use FlexibleSearchUtils.buildOracleCompatibleCollectionStatement. The only drawback is that it will test every time if the DB is Oracle or not. Also the name should not contains "Oracle" since this method works for all DB (there is just a special treatment when using Oracle)

In an other hand I don't see any reference to this method in documentations.

So it is a good or a bad practice to always use FlexibleSearchUtils.buildOracleCompatibleCollectionStatement?

Accepted Solutions (1)

Accepted Solutions (1)

former_member469962
Contributor
0 Kudos

Hello Alain,

As you may already know, there is a limitation on the number of parameters that can be sent to Oracle DB. The impl FlexibleSearchUtils.buildOracleCompatibleCollectionStatement helps counter this. The only Oracle specific code in there is the check for DB == ORACLE. I would advise you to use the FlexibleSearchUtils if you expect more than 1000 input parameters in your custom queries. In case you ever switch to Oracle DB, then your project will not require any adjustments to overcome Oracle limit specific errors.

Hope this helps!

Warm regards,
Shwetha

Former Member
0 Kudos

Ok thanks!

Answers (0)

Ask a Question