1 19 20 package org.netbeans.modules.dbschema; 21 22 25 public final class ColumnPairElement extends DBMemberElement { 26 27 private ColumnElement _localColumn; 28 29 30 private ColumnElement _referencedColumn; 31 32 34 public ColumnPairElement() { 35 this(new Memory(), null, null, null); 36 } 37 38 43 public ColumnPairElement (ColumnElement localColumn, ColumnElement referencedColumn, TableElement declaringTable) { 44 this(new Memory(), localColumn, referencedColumn, declaringTable); 45 } 46 47 53 public ColumnPairElement (ColumnPairElement.Impl impl, ColumnElement localColumn, ColumnElement referencedColumn, TableElement declaringTable) { 54 super(impl, declaringTable); 55 _localColumn = localColumn; 56 _referencedColumn = referencedColumn; 57 } 58 59 62 final Impl getColumnPairImpl() { 63 return (Impl)getElementImpl(); 64 } 65 66 69 public final ColumnElement getLocalColumn() { 70 return _localColumn; 71 } 72 73 76 public final void setLocalColumn (ColumnElement ce) { 77 if (_localColumn == null) 78 _localColumn = ce; 79 } 80 81 84 public final ColumnElement getReferencedColumn() { 85 return _referencedColumn; 86 } 87 88 91 public final void setReferencedColumn(ColumnElement ce) { 92 if (_referencedColumn == null) 93 _referencedColumn = ce; 94 } 95 96 99 public DBIdentifier getName() { 100 ColumnElement lce = getLocalColumn(); 101 ColumnElement fce = getReferencedColumn(); 102 103 DBIdentifier name = DBIdentifier.create(lce.getName().getFullName() + ";" + fce.getName().getFullName()); 105 return name; 106 } 107 108 111 public interface Impl extends DBMemberElement.Impl { 112 } 113 114 static class Memory extends DBMemberElement.Memory implements Impl { 115 117 Memory() { 118 } 119 120 123 Memory(ColumnPairElement column) { 124 super(column); 125 } 126 } 127 } 128 | Popular Tags |