Difference between revisions of "Documentation/DevGuide/Database/Index Service"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Robot: Changing Category:Documentation/Developers Guide/Database Access)
m (FINAL VERSION FOR L10N)
Line 6: Line 6:
 
|NextPage=Documentation/DevGuide/Database/Key Service
 
|NextPage=Documentation/DevGuide/Database/Key Service
 
}}
 
}}
{{DISPLAYTITLE:Index Service}}
+
{{Documentation/DevGuideLanguages|Documentation/DevGuide/Database/{{SUBPAGENAME}}}}
 +
{{DISPLAYTITLE:Index Service}}
 
The Index service encapsulates indexes at a table object. An index is described through the properties <code>Name</code>, <code>Catalog</code>, <code>IsUnique</code>, <code>IsPrimaryKeyIndex</code>, and <code>IsClustered</code>. All properties are read-only if an index has not been added to a tables index container. The last three properties are boolean values that indicate an index object only allows unique values, is used for the primary key, and if it is clustered. The property <code>IsPrimaryKeyIndex</code> is only available after the index has been created because it defines a special index that is created by the database while creating a primary key for a table object. Not all databases currently available in {{PRODUCTNAME}} API support primary keys.
 
The Index service encapsulates indexes at a table object. An index is described through the properties <code>Name</code>, <code>Catalog</code>, <code>IsUnique</code>, <code>IsPrimaryKeyIndex</code>, and <code>IsClustered</code>. All properties are read-only if an index has not been added to a tables index container. The last three properties are boolean values that indicate an index object only allows unique values, is used for the primary key, and if it is clustered. The property <code>IsPrimaryKeyIndex</code> is only available after the index has been created because it defines a special index that is created by the database while creating a primary key for a table object. Not all databases currently available in {{PRODUCTNAME}} API support primary keys.
  

Revision as of 12:51, 15 May 2009



The Index service encapsulates indexes at a table object. An index is described through the properties Name, Catalog, IsUnique, IsPrimaryKeyIndex, and IsClustered. All properties are read-only if an index has not been added to a tables index container. The last three properties are boolean values that indicate an index object only allows unique values, is used for the primary key, and if it is clustered. The property IsPrimaryKeyIndex is only available after the index has been created because it defines a special index that is created by the database while creating a primary key for a table object. Not all databases currently available in OpenOffice.org API support primary keys.

Index

The following code fragment displays the properties of a given index object:

 // index properties
 public static void printIndexProperties(Object index) throws Exception, SQLException {
     System.out.println("Example printIndexProperties");
     XPropertySet xProp = (XPropertySet)UnoRuntime.queryInterface(XPropertySet.class, index);
     System.out.println("Name: " + xProp.getPropertyValue("Name"));
     System.out.println("Catalog: " + xProp.getPropertyValue("Catalog"));
     System.out.println("IsUnique: " + xProp.getPropertyValue("IsUnique"));
     System.out.println("IsPrimaryKeyIndex: " + xProp.getPropertyValue("IsPrimaryKeyIndex"));
     System.out.println("IsClustered: " + xProp.getPropertyValue("IsClustered"));
 }
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages