Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
0.9rc1, 0.9rc2, 0.9rc3
-
None
-
None
Description
Searching for Business & Service by LANG_CODE shouldn't require an exact match. Right now when searching for a BusinessEntity or BusinessService using name and lang code the lang value used in the search must match the lang value in the registry exactly.
For example, if two BusinessEntities exist and have names saved with language codes of "en_US" and "en_UK" respectively ... when searching for BusinessEntities using a language code of "en" both of these businessEntities should returned. Currently neither will be returned because the language code values in the registry do not match the language code value used in the search 'exactly'.
To fix this edit the source of the following two classes:
o.a.j.datastore.jdbc.FindBusinessByNameQuery.java
o.a.j.datastore.jdbc.FindServiceByNameQuery.java
And replace this:
if ((lang != null) && (lang.length() > 0))
{ sql.append(" AND LANG_CODE = ?"); sql.addValue(lang); }With this:
// If lang is "en" we'll need to match with "en", "en_US" or "en_UK"
if ((lang != null) && (lang.length() > 0))