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.

TableDefinition.java 3.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. Copyright (c) 2022 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. import java.time.LocalDateTime;
  16. import java.util.List;
  17. /**
  18. * The definition of a single database table. A TableDefinition instance is
  19. * retrieved from a {@link TableMetaData} instance. The TableDefinition
  20. * instance only provides access to the table metadata, but no table data.
  21. * <p>
  22. * A TableDefinition instance is not thread-safe (see {@link Database} for
  23. * more thread-safety details).
  24. *
  25. * @author James Ahlborn
  26. * @usage _intermediate_class_
  27. */
  28. public interface TableDefinition
  29. {
  30. /**
  31. * @return The name of the table
  32. * @usage _general_method_
  33. */
  34. public String getName();
  35. /**
  36. * Whether or not this table has been marked as hidden.
  37. * @usage _general_method_
  38. */
  39. public boolean isHidden();
  40. /**
  41. * Whether or not this table is a system (internal) table.
  42. * @usage _general_method_
  43. */
  44. public boolean isSystem();
  45. /**
  46. * @usage _general_method_
  47. */
  48. public int getColumnCount();
  49. /**
  50. * @usage _general_method_
  51. */
  52. public Database getDatabase();
  53. /**
  54. * @return All of the columns in this table (unmodifiable List)
  55. * @usage _general_method_
  56. */
  57. public List<? extends Column> getColumns();
  58. /**
  59. * @return the column with the given name
  60. * @usage _general_method_
  61. */
  62. public Column getColumn(String name);
  63. /**
  64. * @return the properties for this table
  65. * @usage _general_method_
  66. */
  67. public PropertyMap getProperties() throws IOException;
  68. /**
  69. * @return the created date for this table if available
  70. * @usage _general_method_
  71. */
  72. public LocalDateTime getCreatedDate() throws IOException;
  73. /**
  74. * Note: jackcess <i>does not automatically update the modified date of a
  75. * Table</i>.
  76. *
  77. * @return the last updated date for this table if available
  78. * @usage _general_method_
  79. */
  80. public LocalDateTime getUpdatedDate() throws IOException;
  81. /**
  82. * @return All of the Indexes on this table (unmodifiable List)
  83. * @usage _intermediate_method_
  84. */
  85. public List<? extends Index> getIndexes();
  86. /**
  87. * @return the index with the given name
  88. * @throws IllegalArgumentException if there is no index with the given name
  89. * @usage _intermediate_method_
  90. */
  91. public Index getIndex(String name);
  92. /**
  93. * @return the primary key index for this table
  94. * @throws IllegalArgumentException if there is no primary key index on this
  95. * table
  96. * @usage _intermediate_method_
  97. */
  98. public Index getPrimaryKeyIndex();
  99. /**
  100. * @return the foreign key index joining this table to the given other table
  101. * @throws IllegalArgumentException if there is no relationship between this
  102. * table and the given table
  103. * @usage _intermediate_method_
  104. */
  105. public Index getForeignKeyIndex(Table otherTable);
  106. }