1 7 package Olj.impl; 8 9 import Olj.OljPackage; 10 import Olj.RelationColumnType; 11 import Olj.RelationModeType; 12 13 import org.eclipse.emf.common.notify.Notification; 14 15 import org.eclipse.emf.ecore.EClass; 16 import org.eclipse.emf.ecore.EStructuralFeature; 17 18 import org.eclipse.emf.ecore.impl.ENotificationImpl; 19 import org.eclipse.emf.ecore.impl.EObjectImpl; 20 21 41 public class RelationColumnTypeImpl extends EObjectImpl implements RelationColumnType { 42 50 protected static final String DEFAULT_VALUE_EDEFAULT = null; 51 52 60 protected String defaultValue = DEFAULT_VALUE_EDEFAULT; 61 62 70 protected static final RelationModeType RELATION_MODE_EDEFAULT = RelationModeType.KEY_LITERAL; 71 72 80 protected RelationModeType relationMode = RELATION_MODE_EDEFAULT; 81 82 89 protected boolean relationModeESet = false; 90 91 99 protected static final String RELATION_SOURCE_COLUMN_NAME_EDEFAULT = null; 100 101 109 protected String relationSourceColumnName = RELATION_SOURCE_COLUMN_NAME_EDEFAULT; 110 111 119 protected static final String RELATION_SOURCE_TABLE_ID_EDEFAULT = null; 120 121 129 protected String relationSourceTableID = RELATION_SOURCE_TABLE_ID_EDEFAULT; 130 131 139 protected static final String RELATION_SOURCE_TABLE_NAME_EDEFAULT = null; 140 141 149 protected String relationSourceTableName = RELATION_SOURCE_TABLE_NAME_EDEFAULT; 150 151 159 protected static final String RELATION_TARGET_COLUMN_NAME_EDEFAULT = null; 160 161 169 protected String relationTargetColumnName = RELATION_TARGET_COLUMN_NAME_EDEFAULT; 170 171 179 protected static final String RELATION_TARGET_TABLE_ID_EDEFAULT = null; 180 181 189 protected String relationTargetTableID = RELATION_TARGET_TABLE_ID_EDEFAULT; 190 191 199 protected static final String RELATION_TARGET_TABLE_NAME_EDEFAULT = null; 200 201 209 protected String relationTargetTableName = RELATION_TARGET_TABLE_NAME_EDEFAULT; 210 211 216 protected RelationColumnTypeImpl() { 217 super(); 218 } 219 220 225 protected EClass eStaticClass() { 226 return OljPackage.eINSTANCE.getRelationColumnType(); 227 } 228 229 234 public String getDefaultValue() { 235 return defaultValue; 236 } 237 238 243 public void setDefaultValue(String newDefaultValue) { 244 String oldDefaultValue = defaultValue; 245 defaultValue = newDefaultValue; 246 if (eNotificationRequired()) 247 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.RELATION_COLUMN_TYPE__DEFAULT_VALUE, oldDefaultValue, defaultValue)); 248 } 249 250 255 public RelationModeType getRelationMode() { 256 return relationMode; 257 } 258 259 264 public void setRelationMode(RelationModeType newRelationMode) { 265 RelationModeType oldRelationMode = relationMode; 266 relationMode = newRelationMode == null ? RELATION_MODE_EDEFAULT : newRelationMode; 267 boolean oldRelationModeESet = relationModeESet; 268 relationModeESet = true; 269 if (eNotificationRequired()) 270 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.RELATION_COLUMN_TYPE__RELATION_MODE, oldRelationMode, relationMode, !oldRelationModeESet)); 271 } 272 273 278 public void unsetRelationMode() { 279 RelationModeType oldRelationMode = relationMode; 280 boolean oldRelationModeESet = relationModeESet; 281 relationMode = RELATION_MODE_EDEFAULT; 282 relationModeESet = false; 283 if (eNotificationRequired()) 284 eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.RELATION_COLUMN_TYPE__RELATION_MODE, oldRelationMode, RELATION_MODE_EDEFAULT, oldRelationModeESet)); 285 } 286 287 292 public boolean isSetRelationMode() { 293 return relationModeESet; 294 } 295 296 301 public String getRelationSourceColumnName() { 302 return relationSourceColumnName; 303 } 304 305 310 public void setRelationSourceColumnName(String newRelationSourceColumnName) { 311 String oldRelationSourceColumnName = relationSourceColumnName; 312 relationSourceColumnName = newRelationSourceColumnName; 313 if (eNotificationRequired()) 314 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.RELATION_COLUMN_TYPE__RELATION_SOURCE_COLUMN_NAME, oldRelationSourceColumnName, relationSourceColumnName)); 315 } 316 317 322 public String getRelationSourceTableID() { 323 return relationSourceTableID; 324 } 325 326 331 public void setRelationSourceTableID(String newRelationSourceTableID) { 332 String oldRelationSourceTableID = relationSourceTableID; 333 relationSourceTableID = newRelationSourceTableID; 334 if (eNotificationRequired()) 335 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.RELATION_COLUMN_TYPE__RELATION_SOURCE_TABLE_ID, oldRelationSourceTableID, relationSourceTableID)); 336 } 337 338 343 public String getRelationSourceTableName() { 344 return relationSourceTableName; 345 } 346 347 352 public void setRelationSourceTableName(String newRelationSourceTableName) { 353 String oldRelationSourceTableName = relationSourceTableName; 354 relationSourceTableName = newRelationSourceTableName; 355 if (eNotificationRequired()) 356 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.RELATION_COLUMN_TYPE__RELATION_SOURCE_TABLE_NAME, oldRelationSourceTableName, relationSourceTableName)); 357 } 358 359 364 public String getRelationTargetColumnName() { 365 return relationTargetColumnName; 366 } 367 368 373 public void setRelationTargetColumnName(String newRelationTargetColumnName) { 374 String oldRelationTargetColumnName = relationTargetColumnName; 375 relationTargetColumnName = newRelationTargetColumnName; 376 if (eNotificationRequired()) 377 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.RELATION_COLUMN_TYPE__RELATION_TARGET_COLUMN_NAME, oldRelationTargetColumnName, relationTargetColumnName)); 378 } 379 380 385 public String getRelationTargetTableID() { 386 return relationTargetTableID; 387 } 388 389 394 public void setRelationTargetTableID(String newRelationTargetTableID) { 395 String oldRelationTargetTableID = relationTargetTableID; 396 relationTargetTableID = newRelationTargetTableID; 397 if (eNotificationRequired()) 398 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.RELATION_COLUMN_TYPE__RELATION_TARGET_TABLE_ID, oldRelationTargetTableID, relationTargetTableID)); 399 } 400 401 406 public String getRelationTargetTableName() { 407 return relationTargetTableName; 408 } 409 410 415 public void setRelationTargetTableName(String newRelationTargetTableName) { 416 String oldRelationTargetTableName = relationTargetTableName; 417 relationTargetTableName = newRelationTargetTableName; 418 if (eNotificationRequired()) 419 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.RELATION_COLUMN_TYPE__RELATION_TARGET_TABLE_NAME, oldRelationTargetTableName, relationTargetTableName)); 420 } 421 422 427 public Object eGet(EStructuralFeature eFeature, boolean resolve) { 428 switch (eDerivedStructuralFeatureID(eFeature)) { 429 case OljPackage.RELATION_COLUMN_TYPE__DEFAULT_VALUE: 430 return getDefaultValue(); 431 case OljPackage.RELATION_COLUMN_TYPE__RELATION_MODE: 432 return getRelationMode(); 433 case OljPackage.RELATION_COLUMN_TYPE__RELATION_SOURCE_COLUMN_NAME: 434 return getRelationSourceColumnName(); 435 case OljPackage.RELATION_COLUMN_TYPE__RELATION_SOURCE_TABLE_ID: 436 return getRelationSourceTableID(); 437 case OljPackage.RELATION_COLUMN_TYPE__RELATION_SOURCE_TABLE_NAME: 438 return getRelationSourceTableName(); 439 case OljPackage.RELATION_COLUMN_TYPE__RELATION_TARGET_COLUMN_NAME: 440 return getRelationTargetColumnName(); 441 case OljPackage.RELATION_COLUMN_TYPE__RELATION_TARGET_TABLE_ID: 442 return getRelationTargetTableID(); 443 case OljPackage.RELATION_COLUMN_TYPE__RELATION_TARGET_TABLE_NAME: 444 return getRelationTargetTableName(); 445 } 446 return eDynamicGet(eFeature, resolve); 447 } 448 449 454 public void eSet(EStructuralFeature eFeature, Object newValue) { 455 switch (eDerivedStructuralFeatureID(eFeature)) { 456 case OljPackage.RELATION_COLUMN_TYPE__DEFAULT_VALUE: 457 setDefaultValue((String )newValue); 458 return; 459 case OljPackage.RELATION_COLUMN_TYPE__RELATION_MODE: 460 setRelationMode((RelationModeType)newValue); 461 return; 462 case OljPackage.RELATION_COLUMN_TYPE__RELATION_SOURCE_COLUMN_NAME: 463 setRelationSourceColumnName((String )newValue); 464 return; 465 case OljPackage.RELATION_COLUMN_TYPE__RELATION_SOURCE_TABLE_ID: 466 setRelationSourceTableID((String )newValue); 467 return; 468 case OljPackage.RELATION_COLUMN_TYPE__RELATION_SOURCE_TABLE_NAME: 469 setRelationSourceTableName((String )newValue); 470 return; 471 case OljPackage.RELATION_COLUMN_TYPE__RELATION_TARGET_COLUMN_NAME: 472 setRelationTargetColumnName((String )newValue); 473 return; 474 case OljPackage.RELATION_COLUMN_TYPE__RELATION_TARGET_TABLE_ID: 475 setRelationTargetTableID((String )newValue); 476 return; 477 case OljPackage.RELATION_COLUMN_TYPE__RELATION_TARGET_TABLE_NAME: 478 setRelationTargetTableName((String )newValue); 479 return; 480 } 481 eDynamicSet(eFeature, newValue); 482 } 483 484 489 public void eUnset(EStructuralFeature eFeature) { 490 switch (eDerivedStructuralFeatureID(eFeature)) { 491 case OljPackage.RELATION_COLUMN_TYPE__DEFAULT_VALUE: 492 setDefaultValue(DEFAULT_VALUE_EDEFAULT); 493 return; 494 case OljPackage.RELATION_COLUMN_TYPE__RELATION_MODE: 495 unsetRelationMode(); 496 return; 497 case OljPackage.RELATION_COLUMN_TYPE__RELATION_SOURCE_COLUMN_NAME: 498 setRelationSourceColumnName(RELATION_SOURCE_COLUMN_NAME_EDEFAULT); 499 return; 500 case OljPackage.RELATION_COLUMN_TYPE__RELATION_SOURCE_TABLE_ID: 501 setRelationSourceTableID(RELATION_SOURCE_TABLE_ID_EDEFAULT); 502 return; 503 case OljPackage.RELATION_COLUMN_TYPE__RELATION_SOURCE_TABLE_NAME: 504 setRelationSourceTableName(RELATION_SOURCE_TABLE_NAME_EDEFAULT); 505 return; 506 case OljPackage.RELATION_COLUMN_TYPE__RELATION_TARGET_COLUMN_NAME: 507 setRelationTargetColumnName(RELATION_TARGET_COLUMN_NAME_EDEFAULT); 508 return; 509 case OljPackage.RELATION_COLUMN_TYPE__RELATION_TARGET_TABLE_ID: 510 setRelationTargetTableID(RELATION_TARGET_TABLE_ID_EDEFAULT); 511 return; 512 case OljPackage.RELATION_COLUMN_TYPE__RELATION_TARGET_TABLE_NAME: 513 setRelationTargetTableName(RELATION_TARGET_TABLE_NAME_EDEFAULT); 514 return; 515 } 516 eDynamicUnset(eFeature); 517 } 518 519 524 public boolean eIsSet(EStructuralFeature eFeature) { 525 switch (eDerivedStructuralFeatureID(eFeature)) { 526 case OljPackage.RELATION_COLUMN_TYPE__DEFAULT_VALUE: 527 return DEFAULT_VALUE_EDEFAULT == null ? defaultValue != null : !DEFAULT_VALUE_EDEFAULT.equals(defaultValue); 528 case OljPackage.RELATION_COLUMN_TYPE__RELATION_MODE: 529 return isSetRelationMode(); 530 case OljPackage.RELATION_COLUMN_TYPE__RELATION_SOURCE_COLUMN_NAME: 531 return RELATION_SOURCE_COLUMN_NAME_EDEFAULT == null ? relationSourceColumnName != null : !RELATION_SOURCE_COLUMN_NAME_EDEFAULT.equals(relationSourceColumnName); 532 case OljPackage.RELATION_COLUMN_TYPE__RELATION_SOURCE_TABLE_ID: 533 return RELATION_SOURCE_TABLE_ID_EDEFAULT == null ? relationSourceTableID != null : !RELATION_SOURCE_TABLE_ID_EDEFAULT.equals(relationSourceTableID); 534 case OljPackage.RELATION_COLUMN_TYPE__RELATION_SOURCE_TABLE_NAME: 535 return RELATION_SOURCE_TABLE_NAME_EDEFAULT == null ? relationSourceTableName != null : !RELATION_SOURCE_TABLE_NAME_EDEFAULT.equals(relationSourceTableName); 536 case OljPackage.RELATION_COLUMN_TYPE__RELATION_TARGET_COLUMN_NAME: 537 return RELATION_TARGET_COLUMN_NAME_EDEFAULT == null ? relationTargetColumnName != null : !RELATION_TARGET_COLUMN_NAME_EDEFAULT.equals(relationTargetColumnName); 538 case OljPackage.RELATION_COLUMN_TYPE__RELATION_TARGET_TABLE_ID: 539 return RELATION_TARGET_TABLE_ID_EDEFAULT == null ? relationTargetTableID != null : !RELATION_TARGET_TABLE_ID_EDEFAULT.equals(relationTargetTableID); 540 case OljPackage.RELATION_COLUMN_TYPE__RELATION_TARGET_TABLE_NAME: 541 return RELATION_TARGET_TABLE_NAME_EDEFAULT == null ? relationTargetTableName != null : !RELATION_TARGET_TABLE_NAME_EDEFAULT.equals(relationTargetTableName); 542 } 543 return eDynamicIsSet(eFeature); 544 } 545 546 551 public String toString() { 552 if (eIsProxy()) return super.toString(); 553 554 StringBuffer result = new StringBuffer (super.toString()); 555 result.append(" (defaultValue: "); 556 result.append(defaultValue); 557 result.append(", relationMode: "); 558 if (relationModeESet) result.append(relationMode); else result.append("<unset>"); 559 result.append(", relationSourceColumnName: "); 560 result.append(relationSourceColumnName); 561 result.append(", relationSourceTableID: "); 562 result.append(relationSourceTableID); 563 result.append(", relationSourceTableName: "); 564 result.append(relationSourceTableName); 565 result.append(", relationTargetColumnName: "); 566 result.append(relationTargetColumnName); 567 result.append(", relationTargetTableID: "); 568 result.append(relationTargetTableID); 569 result.append(", relationTargetTableName: "); 570 result.append(relationTargetTableName); 571 result.append(')'); 572 return result.toString(); 573 } 574 575 } | Popular Tags |