code: public static String getRid(final Object value) {
          Preconditions.checkNotNull(value, "Not null value required");
          final String res;
          if (value instanceof ORID) {
              res = value.toString();
          } else if (value instanceof OIdentifiable) {
              // ODocument, Vertex support
              res = ((OIdentifiable) value).getIdentity().toString();
          } else if (value instanceof String) {
              res = checkRid(value);
          } else if (value instanceof Proxy) {
              // object proxy
              res = OObjectEntitySerializer.getRid((Proxy) value).toString();
          } else {
              // raw (non proxy) object
              res = resolveIdFromObject(value);
          }
          return res;
      }
docs: Resolve rid from almost all possible objects.
  Even if simple string provided, value will be checked for correctness.
  <p>
  Note: not saved object proxy, document or vertex will contain fake id and will be accepted
  (but query result against such id will be empty).
  
  @param value value may be a mapped object (proxy or raw), document, vertex, ORID or simple string
  @return correct rid string
  @throws ru.vyarus.guice.persist.orient.db.PersistException if rid couldn't be resolved
  @throws NullPointerException                               if value is null