Unable to add @PropertyBinding on a field, which is in includepath or other object
and unable to user criteria “caseKind.translations.en”
This is my mapping as below :
@Indexed
@Table(name="dcase", schema="test")
public class Case extends VersioningEntity {
@IndexedEmbedded(includePaths = {"id", "translations"})
@IndexingDependency(reindexOnUpdate = ReindexOnUpdate.SHALLOW)
@ManyToOne
@JoinColumn(name="case_kind_type_id")
private CaseKindType caseKind;
}
@Entity
@Table(name="case_kind_type", schema="test")
public class CaseKindType extends Localisable implements Serializable {
@OneToMany
@JoinColumn(name="`key`", referencedColumnName="case_kind_name")
@GenericField(projectable = Projectable.YES)
@PropertyBinding(binder = @PropertyBinderRef(type = I18FieldBinder.class))
private Set<Translation> translations;
}
The above mapping throwing error as below:
Hibernate ORM mapping:
type 'com.eurodyn.eips.core.db.entity.Case':
path '.caseKind<no value extractors>.translations':
failures:
- HSEARCH000135: No default value bridge implementation for type 'com.eurodyn.eips.core.db.entity.Translation'. Use a custom bridge.
I want to search sort or search data with criteria “caseKind.translations.en” here we have translation with multiple language code like “en,nl,fr”
earlier I am using Valuebridge as below which is not working with above criteria:
@GenericField(projectable = Projectable.YES, valueBridge = @ValueBridgeRef(type = I18FieldBridge.class))
public class I18FieldBridge implements ValueBridge<Translation, String> {
@Override
public String toIndexedValue(Translation translation, ValueBridgeToIndexedValueContext context) {
return translation == null ? null : translation.getDescription() + "." + translation.getLanguageCode();
}
}
it is storing data as
translations:
{
1: “data.en”
2: “data.nl”
3: “data.fr”
}
I think I need to store data as below to use criteria “caseKind.translations.en” :
translations:
{
en: “data”
nl: “data”
fr: “data”
}
Please help me to achive it.