NumberToStringValueBridge.ktValueBridge<Number, String> that converts numeric entity fields to strings for full-text indexing and back to numbers when reading from the index. Enables text-based search queries to match numeric fields.class NumberToStringValueBridge : ValueBridge<Number, String>
Number (any numeric type from the entity: Int, Long, Double, etc.)String (the searchable representation in the index)toIndexedValue and fromIndexedValuetoIndexedValue(value, context): String?Converts the Number to its string representation via value?.toString(). Returns null for null input.
fromIndexedValue(value, context): Number?Reconstructs a Number from the indexed string. Tries parsing in this order:
toLongOrNull() — handles integer values (most common case for IDs)toDoubleOrNull() — handles decimal valuestoIntOrNull() — fallback for values that don't fit the aboveReturns null if none parse successfully.
toString(): StringReturns "NumberToStringValueBridge" for bridge identification in logs/debug output.
Used when entity numeric fields (e.g., invoice numbers, monetary amounts, quantities) need to be searchable via Hibernate Search full-text queries. Without this bridge, numeric fields would need separate range queries or exact-match filters. By converting to strings, users can search for e.g. "100" and match records where amount = 100.0 or invoiceNumber = 100.
868d6abb7 2025 -> 2026 63081666f Source file headers: 2024-> 2025. 2d324f2bb Finance: incoming invoices fixed. cf00da112 Migration stuff in progress... 4f5a458c9 Migration stuff in progress... b6092df09 Copyright 2023 -> 2024 ab45d51fa Copyright 2001-2022 -> 2001-2023. 5f7ef41b8 Copyright 2021 -> 2022 ceb63e8a1 Source code header: (C) 2001-2021. 0e850ecb2 Plugins don't need to be spring components, ServiceLoader is used again. c526c1bbb I18nEnum, IUserRightId -> Kotlin. 7c79f1922 Copyright of source header -> 2020. dd5ca38ac CopyRight of all java file-header updated or created. 9ebb88522 Initial commit