1. /*
  2. * Copyright 2002 Sun Microsystems, Inc. All rights reserved.
  3. * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
  4. */
  5. package javax.resource.cci;
  6. /** The <code>javax.resource.cci.Record</code> interface is the base
  7. * interface for the representation of an input or output to the
  8. * execute methods defined on an Interaction.
  9. *
  10. * <p>The Record interface can be extended to form a one of the
  11. * following representations:
  12. * <UL>
  13. * <LI> MappedRecord: A key-value pair based collection represents
  14. * a record. This interface is based on the <code>java.util.Map</code>
  15. * <LI> IndexedRecord:An ordered and indexed collection represents
  16. * a record. This interface is based on the <code>java.util.List</code>.
  17. * <LI> JavaBean based representation of an EIS abstraction: An
  18. * example is a custom record generated to represent a purchase
  19. * order in an ERP system.
  20. * <LI> <code>javax.resource.cci.ResultSet</code>: This interface
  21. * extends both <code>java.sql.ResultSet</code> and <code>
  22. * javax.resource.cci.Record</code>. A ResultSet
  23. * represents tabular data.
  24. * </UL>
  25. *
  26. * <p>A MappedRecord or IndexedRecord can contain another Record. This
  27. * means that MappedRecord and IndexedRecord can be used to create
  28. * a hierarchical structure of any arbitrary depth. A basic Java
  29. * type is used as the leaf element of a hierarchical structure
  30. * represented by a MappedRecord or IndexedRecord.
  31. *
  32. * @author Rahul Sharma
  33. * @version 0.8
  34. * @see javax.resource.cci.Interaction
  35. * @see java.sql.ResultSet
  36. **/
  37. public interface Record extends java.lang.Cloneable, java.io.Serializable {
  38. /** Gets the name of the Record.
  39. *
  40. * @return String representing name of the Record
  41. **/
  42. public
  43. String getRecordName();
  44. /** Sets the name of the Record.
  45. *
  46. * @param name Name of the Record
  47. **/
  48. public
  49. void setRecordName(String name);
  50. /** Sets a short description string for the Record. This property
  51. * is used primarily by application development tools.
  52. *
  53. * @param description Description of the Record
  54. **/
  55. public
  56. void setRecordShortDescription(String description);
  57. /** Gets a short description string for the Record. This property
  58. * is used primarily by application development tools.
  59. *
  60. * @return String representing a short description of the Record
  61. **/
  62. public
  63. String getRecordShortDescription();
  64. /** Check if this instance is equal to another Record.
  65. *
  66. * @return true if two instances are equal
  67. **/
  68. public
  69. boolean equals(Object other);
  70. /** Returns the hash code for the Record instance.
  71. *
  72. * @return hash code
  73. **/
  74. public
  75. int hashCode();
  76. /** Creates and returns a copy of this object. The precise
  77. * meaning of "copy" may depend on the class of the object.
  78. *
  79. * @returns a clone of this instance.
  80. * @throws CloneNotSupportedException
  81. * If the object's class does not support the
  82. * Cloneable interface Subclasses that override the
  83. * clone method can also throw this exception to
  84. * indicate that an instance cannot be cloned.
  85. **/
  86. public
  87. Object clone() throws CloneNotSupportedException;
  88. }