Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

Reference.java 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /*
  2. @VaadinApache2LicenseForJavaFiles@
  3. */
  4. package com.vaadin.data.util.sqlcontainer;
  5. import java.io.Serializable;
  6. /**
  7. * The reference class represents a simple [usually foreign key] reference to
  8. * another SQLContainer. Actual foreign key reference in the database is not
  9. * required, but it is recommended to make sure that certain constraints are
  10. * followed.
  11. */
  12. @SuppressWarnings("serial")
  13. class Reference implements Serializable {
  14. /**
  15. * The SQLContainer that this reference points to.
  16. */
  17. private SQLContainer referencedContainer;
  18. /**
  19. * The column ID/name in the referencing SQLContainer that contains the key
  20. * used for the reference.
  21. */
  22. private String referencingColumn;
  23. /**
  24. * The column ID/name in the referenced SQLContainer that contains the key
  25. * used for the reference.
  26. */
  27. private String referencedColumn;
  28. /**
  29. * Constructs a new reference to be used within the SQLContainer to
  30. * reference another SQLContainer.
  31. */
  32. Reference(SQLContainer referencedContainer, String referencingColumn,
  33. String referencedColumn) {
  34. this.referencedContainer = referencedContainer;
  35. this.referencingColumn = referencingColumn;
  36. this.referencedColumn = referencedColumn;
  37. }
  38. SQLContainer getReferencedContainer() {
  39. return referencedContainer;
  40. }
  41. String getReferencingColumn() {
  42. return referencingColumn;
  43. }
  44. String getReferencedColumn() {
  45. return referencedColumn;
  46. }
  47. }