orientdb
orientdb copied to clipboard
OIndex#get is marked as deprecated, what should be used to load ORecordId instead
OrientDB Version: 3.1.14
Java Version: jdk 1.8._211
OS: Win10
OIndex.get is now marked as deprecated Java doc suggest to use {@link OIndexInternal#getRids(Object)} instead but only as internal (not public) API.
I don't find anything documented about it, just method deprecated (looking OIndexRemoteOneValue)
I'm using ODatabaseSession after remote connection. What method I should use to load ORecordId using index?
ORecordId idEntity = (ORecordId) oIndex.get("value-on-indexed-field");
What is the correct methods for performing this task on index?
Hi, You can use a query directly, as the implementation of the deprecated method is doing, the query would be:
select expand( rid ) from index:`index.name` where key = ?
Thanks, but there how use the suggested replaced method instead? When the method will be removed I think that I should use another method, isn't it?
Looking issue https://github.com/orientechnologies/orientdb/issues/9461 I have a concern about to find a solution.
If the deprecation code say that I have to use OIndexInternal I suppose that I have to use
OIndex.getInternal
Now when I load the index using it's name:
ODatabaseSession#getClass("myClass").getClassIndex("indexName");
I have an OIndexRemote.
Now looking the code of OIndexRemote:
So for me is impossible to use another method instead of the deprecated one IS there something that I forget or that I wrong?
@gianluca-valentini san,
IS there something that I forget or that I wrong?
Did you get any answer? Or Did you replace OrientDB by any other database?
Ho @cuongrep I never received any response. For this reason and other issues, we decided to replace orientdb with another open source database that gives more support and capabilities
Hi,
The solution is the query, as mentioned before, if there will be a replacement method, will be implemented with the query , so you can use that directly in the meanwhile.
Regards
@gianluca-valentini
I never received any response. For this reason and other issues, we decided to replace orientdb with another open source database that gives more support and capabilities
Thank you for your sharing. We also have a plan to get over the pain of replacing OrientDB because we are so tired of using it.
@tglman Thank you for your support. We don't have time to waste, so we have to give up to use OrientDB.
Hi @cuongrep,
I completely understand you, I do use the same approach when I do support users!