orientdb icon indicating copy to clipboard operation
orientdb copied to clipboard

OIndex#get is marked as deprecated, what should be used to load ORecordId instead

Open gianluca-valentini opened this issue 3 years ago • 9 comments

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) image

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?

gianluca-valentini avatar Dec 28 '21 15:12 gianluca-valentini

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 = ?

tglman avatar Jan 05 '22 12:01 tglman

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?

gianluca-valentini avatar Jan 05 '22 12:01 gianluca-valentini

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: image

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 avatar Apr 12 '22 09:04 gianluca-valentini

@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?

cuongrep avatar Jan 24 '24 05:01 cuongrep

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

gianluca-valentini avatar Jan 24 '24 05:01 gianluca-valentini

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

tglman avatar Jan 24 '24 13:01 tglman

@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.

cuongrep avatar Jan 25 '24 03:01 cuongrep

@tglman Thank you for your support. We don't have time to waste, so we have to give up to use OrientDB.

cuongrep avatar Jan 25 '24 03:01 cuongrep

Hi @cuongrep,

I completely understand you, I do use the same approach when I do support users!

tglman avatar Jan 25 '24 12:01 tglman