Querying case-sensitive string values
dpnolte opened this issue · 2 comments
Dear Xodus-DNQ Maintainers,
Thank you for this awesome lib.
I've learned that string property values are case-insensitive in Xodus (according to the wiki).
Hence, with the following entity:
XdMyEntity(entity: Entity) : XdEntity(entity) {
var name by xdRequiredStringProp()
}
and the following query:
val xdEntities = XdMyEntity.query(
XdMyEntity::name eq "focusable"
).toList()
for (xdMyEntity in xdEntities) {
println(xdMyEntity.name)
}
Suppose that I have two entities with names: "focusable" and "FOCUSABLE"
Then the above query will print both names:
FOCUSABLE
focusable
I was wondering if DNQ has a convenience method to do case-sensitive queries. If not, is it best just to filter the query results with normal kotlin collection operations? In any case, thank you for open sourcing this lib!
Warm regards,
Derk
@dpnolte Yes, it's better to delegate case-sensitive string properties filtering to Kotlin library. For best performance, do such filtering as the most final operation.
ah great, thanks! Maybe worthwhile to mention in the docs - just as on Xodus wiki - that the stored String values are case-insensitive? I can update the docs if you think that is useful