Hi All,
I want to replace below bridge class for hibernate 6 or hibernate7 , can any one help
public class I18FieldBridge implements FieldBridge, Discriminator {
private final Logger log = LoggerFactory.getLogger(getClass());
private static final String CUSTOM_ANALYZER = "customanalyzer";
@SuppressWarnings("unchecked")
public void set(String name, Object value, Document document, LuceneOptions luceneOptions) {
if (value != null) {
Set<Translation> translations = (Set<Translation>) value;
for (Translation translation : translations) {
if (translation == null) {
return;
}
final String fieldName = name + "." + translation.getLanguageCode();
luceneOptions.addFieldToDocument(fieldName, translation.getDescription(), document);
}
} else {
log.warn("Collection of translations NULL for name {}", name);
}
}
@Override
public String getAnalyzerDefinitionName(Object value, Object entity,
String field) {
if(field.contains(FeesSearchFieldEnum.ACCOUNT_TRAN_ITEM_DESCRIPTION.getFieldName())){
return CUSTOM_ANALYZER;
}
return null;
}