title: Getting GAE Entity by Key
body: <p>I've been trying to get an entity from GAE datastore by its key, which is of type Key. Here's the code that I'm using to retrieve the key:</p>
  
  <pre><code>strId = myVideo.getKey().toString();
  </code></pre>
  
  <p>The type of myVideo is Entity. The value that the <code>myVideo.getKey().toString()</code> method returns is "Video(121)". Here's the code that tries to retrieve the entity via the entity's key:</p>
  
  <pre><code>Entity video = ds.get(key);
  </code></pre>
  
  <p>The following exception gets thrown when trying to retrieve the entity from the datastore: </p>
  
  <blockquote>
    <p>No entity was found matching the key:
    Video("Video(121)")</p>
  </blockquote>
  
  <p>Is there a way to get the encoded key from an object of type Entity?</p>