1 // Copyright 2008 Google Inc. All Rights Reserved.
2 package com
.google
.appengine
.api
.datastore
;
5 * {@code DatastoreNeedIndexException} is thrown when no matching index was
6 * found for a query requiring an index. Check the Indexes page in the Admin
7 * Console and your datastore-indexes.xml file.
10 public class DatastoreNeedIndexException
extends RuntimeException
{
12 static final long serialVersionUID
= 9218197931741583584L;
14 static final String NO_XML_MESSAGE
= "\nAn index is missing but we are unable to tell you which "
15 + "one due to a bug in the App Engine SDK. If your query only contains equality filters you "
16 + "most likely need a composite index on all the properties referenced in those filters.";
20 public DatastoreNeedIndexException(String message
) {
25 public String
getMessage() {
26 return super.getMessage() + (xml
== null ? NO_XML_MESSAGE
:
27 "\nThe suggested index for this query is:\n" + xml
);
31 * @return The xml defining the missing index. Can be {@code null}.
33 public String
getMissingIndexDefinitionXml() {
37 void setMissingIndexDefinitionXml(String xml
) {