ObjectDB ObjectDB

Partial Indexing

#1

I have a question about partial indexing.

For example, a field of String type ttt, will be distinguished by the first 5 characters, then I can make a index of substr(ttt,1,5) in MySQL.

With ObjectDB, how can I write the annotation for this purpose?

TIA

=========================================================================
There's never been infinity. Cantor's diagonal proof is completely wrong.
edit
delete
#2

Currently ObjectDB supports only indexing of complete fields (single field or multiple fields).

The obvious workaround is to add to the entity class an additional field that will hold the partial content. You can keep that partial field synchronized with the main field by using a callback method (which will be annotated with @PrePersist and @PreUpdate). The new field should be indexed and used in queries.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
edit
delete
#3

Thanks! Your reply do make sense.

=========================================================================
There's never been infinity. Cantor's diagonal proof is completely wrong.
edit
delete

Reply

To post on this website please sign in.