1 21 package oracle.toplink.essentials.internal.ejb.cmp3.metadata; 22 23 import oracle.toplink.essentials.internal.ejb.cmp3.xml.XMLConstants; 24 25 31 public class MetadataPersistenceUnit { 32 protected String m_access; 33 protected String m_schema; 34 protected String m_catalog; 35 protected String m_conflict; 36 protected boolean m_isCascadePersist; 37 protected boolean m_isMetadataComplete; 38 39 42 public MetadataPersistenceUnit() { 43 m_access = ""; 44 m_schema = ""; 45 m_catalog = ""; 46 m_isCascadePersist = false; 47 m_isMetadataComplete = false; 48 } 49 50 54 public boolean equals(Object objectToCompare) { 55 MetadataPersistenceUnit persistenceUnit = (MetadataPersistenceUnit) objectToCompare; 56 57 if (! persistenceUnit.getAccess().equals(getAccess())) { 58 m_conflict = XMLConstants.ACCESS; 59 return false; 60 } 61 62 if (! persistenceUnit.getCatalog().equals(getCatalog())) { 63 m_conflict = XMLConstants.CATALOG; 64 return false; 65 } 66 67 if (! persistenceUnit.getSchema().equals(getSchema())) { 68 m_conflict = XMLConstants.SCHEMA; 69 return false; 70 } 71 72 if (persistenceUnit.isCascadePersist() != isCascadePersist()) { 73 m_conflict = XMLConstants.CASCADE_PERSIST; 74 return false; 75 } 76 77 if (persistenceUnit.isMetadataComplete() != isMetadataComplete()) { 78 m_conflict = XMLConstants.METADATA_COMPLETE; 79 return false; 80 } 81 82 return true; 83 } 84 85 88 public String getAccess() { 89 return m_access; 90 } 91 92 95 public String getCatalog() { 96 return m_catalog; 97 } 98 99 104 public String getConflict() { 105 return m_conflict; 106 } 107 108 111 public String getSchema() { 112 return m_schema; 113 } 114 115 118 public boolean isCascadePersist() { 119 return m_isCascadePersist; 120 } 121 122 125 public boolean isMetadataComplete() { 126 return m_isMetadataComplete; 127 } 128 129 132 public void setAccess(String access) { 133 m_access = access; 134 } 135 136 139 public void setCatalog(String catalog) { 140 m_catalog = catalog; 141 } 142 143 146 public void setIsCascadePersist(boolean isCascadePersist) { 147 m_isCascadePersist = isCascadePersist; 148 } 149 150 153 public void setIsMetadataComplete(boolean isMetadataComplete) { 154 m_isMetadataComplete = isMetadataComplete; 155 } 156 157 160 public void setSchema(String schema) { 161 m_schema = schema; 162 } 163 } 164 | Popular Tags |