Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

ForeignKeyDbo.java 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. package com.rthoni.intellij.codefromds.dbo.template;
  2. import java.util.List;
  3. import java.util.Vector;
  4. /**
  5. * Created by robin on 11/18/16.
  6. */
  7. public class ForeignKeyDbo {
  8. private TableDataSourceDbo _sourceTable;
  9. private List<ColumnDataSourceDbo> _sourceColumns = new Vector<>();
  10. private TableDataSourceDbo _targetTable;
  11. private List<ColumnDataSourceDbo> _targetColumns = new Vector<>();
  12. private String _sourceForeignKeyName;
  13. private String _targetForeignKeyName;
  14. private String _name;
  15. //
  16. // private ForeignKeyDbo _other;
  17. //
  18. // private boolean _isOneToOne;
  19. //
  20. // private boolean _isOneToMany;
  21. //
  22. // private boolean _isManyToMany;
  23. public TableDataSourceDbo getSourceTable() {
  24. return _sourceTable;
  25. }
  26. public boolean isSelected()
  27. {
  28. return _sourceColumns.stream().allMatch(ColumnDataSourceDbo::isSelected) &&
  29. _targetColumns.stream().allMatch(ColumnDataSourceDbo::isSelected);
  30. }
  31. public void setSourceTable(TableDataSourceDbo sourceTable) {
  32. _sourceTable = sourceTable;
  33. }
  34. public List<ColumnDataSourceDbo> getSourceColumns() {
  35. return _sourceColumns;
  36. }
  37. public void addSourceColumn(ColumnDataSourceDbo sourceColumns) {
  38. _sourceColumns.add(sourceColumns);
  39. }
  40. public TableDataSourceDbo getTargetTable() {
  41. return _targetTable;
  42. }
  43. public void setTargetTable(TableDataSourceDbo targetTable) {
  44. _targetTable = targetTable;
  45. }
  46. public List<ColumnDataSourceDbo> getTargetColumns() {
  47. return _targetColumns;
  48. }
  49. public void addTargetColumn(ColumnDataSourceDbo targetColumns) {
  50. _targetColumns.add(targetColumns);
  51. }
  52. public String getSourceForeignKeyName() {
  53. return _sourceForeignKeyName;
  54. }
  55. public void setSourceForeignKeyName(String sourceForeignKeyName) {
  56. _sourceForeignKeyName = sourceForeignKeyName;
  57. }
  58. public String getTargetForeignKeyName() {
  59. return _targetForeignKeyName;
  60. }
  61. public void setTargetForeignKeyName(String targetForeignKeyName) {
  62. _targetForeignKeyName = targetForeignKeyName;
  63. }
  64. public String getName() {
  65. return _name;
  66. }
  67. public void setName(String name) {
  68. _name = name;
  69. }
  70. // public boolean isOneToOne() {
  71. // return _isOneToOne;
  72. // }
  73. //
  74. // public void setOneToOne(boolean oneToOne) {
  75. // _isOneToOne = oneToOne;
  76. // if (_isOneToOne) {
  77. // _isOneToMany = true;
  78. // _isManyToMany = false;
  79. // }
  80. // }
  81. //
  82. // public boolean isOneToMany() {
  83. // return _isOneToMany;
  84. // }
  85. //
  86. // public void setOneToMany(boolean oneToMany) {
  87. // _isOneToMany = oneToMany;
  88. // if (_isOneToMany) {
  89. // _isOneToOne = true;
  90. // _isManyToMany = false;
  91. // }
  92. // }
  93. //
  94. // public boolean isManyToMany() {
  95. // return _isManyToMany;
  96. // }
  97. //
  98. // public void setManyToMany(boolean manyToMany) {
  99. // _isManyToMany = manyToMany;
  100. // if (_isManyToMany) {
  101. // _isOneToOne = true;
  102. // _isOneToMany = false;
  103. // }
  104. // }
  105. //
  106. // public ForeignKeyDbo getOther() {
  107. // return _other;
  108. // }
  109. //
  110. // public void setOther(ForeignKeyDbo other) {
  111. // _other = other;
  112. // }
  113. }