You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

TableMetaData.java 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*
  2. Copyright (c) 2016 James Ahlborn
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. */
  13. package com.healthmarketscience.jackcess;
  14. import java.io.IOException;
  15. /**
  16. * Basic metadata about a single database Table. This is the top-level
  17. * information stored in a (local) database which can be retrieved without
  18. * attempting to load the Table itself.
  19. *
  20. * @author James Ahlborn
  21. * @usage _intermediate_class_
  22. */
  23. public interface TableMetaData
  24. {
  25. public enum Type {
  26. LOCAL, LINKED, LINKED_ODBC;
  27. }
  28. /**
  29. * The type of table
  30. */
  31. public Type getType();
  32. /**
  33. * The name of the table (as it is stored in the database)
  34. */
  35. public String getName();
  36. /**
  37. * {@code true} if this is a linked table, {@code false} otherwise.
  38. */
  39. public boolean isLinked();
  40. /**
  41. * {@code true} if this is a system table, {@code false} otherwise.
  42. */
  43. public boolean isSystem();
  44. /**
  45. * The name of this linked table in the linked database if this is a linked
  46. * table, {@code null} otherwise.
  47. */
  48. public String getLinkedTableName();
  49. /**
  50. * The name of this the linked database if this is a linked table, {@code
  51. * null} otherwise.
  52. */
  53. public String getLinkedDbName();
  54. /**
  55. * The connection of this the linked database if this is a linked ODBC
  56. * table, {@code null} otherwise.
  57. */
  58. public String getConnectionName();
  59. /**
  60. * Opens this table from the given Database instance.
  61. */
  62. public Table open(Database db) throws IOException;
  63. /**
  64. * Gets the local table definition from the given Database instance if
  65. * available. Only useful for linked ODBC tables.
  66. */
  67. public TableDefinition getTableDefinition(Database db) throws IOException;
  68. }