Created
September 13, 2012 13:39
-
-
Save giastfader/3714347 to your computer and use it in GitHub Desktop.
[OrientDb] using the index java api
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //from: https://groups.google.com/forum/?fromgroups=#!searchin/orient-database/OIdentifiable/orient-database/fwAmlTJy4-c/ne3wpgbSJOEJ | |
| public static ODocument getDoc(String name){ | |
| OGraphDatabase db = OGraphDatabase ((ODatabaseRecordTx)ODatabaseRecordThreadLocal.INSTANCE.get()); | |
| OIndex idx = db.getMetadata().getIndexManager().getIndex("doc.name"); //<<---- the index name | |
| ORecordId record = (ORecordId) idx.get( name ); | |
| return (ODocument) record.getRecord(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment