1 7 package Olj.impl; 8 9 import Olj.CommitType; 10 import Olj.IncludeType; 11 import Olj.JdbcTargetParametersType; 12 import Olj.LogModeType; 13 import Olj.OljPackage; 14 import Olj.OnErrorContinueType; 15 import Olj.SqlStmtType; 16 import Olj.SqlType; 17 18 import org.eclipse.emf.common.notify.Notification; 19 import org.eclipse.emf.common.notify.NotificationChain; 20 21 import org.eclipse.emf.ecore.EClass; 22 import org.eclipse.emf.ecore.EStructuralFeature; 23 import org.eclipse.emf.ecore.InternalEObject; 24 25 import org.eclipse.emf.ecore.impl.ENotificationImpl; 26 import org.eclipse.emf.ecore.impl.EObjectImpl; 27 28 48 public class SqlTypeImpl extends EObjectImpl implements SqlType { 49 57 protected JdbcTargetParametersType jdbcTargetParameters = null; 58 59 67 protected IncludeType include = null; 68 69 77 protected SqlStmtType sqlStmt = null; 78 79 87 protected static final CommitType COMMIT_EDEFAULT = CommitType.TRUE_LITERAL; 88 89 97 protected CommitType commit = COMMIT_EDEFAULT; 98 99 106 protected boolean commitESet = false; 107 108 116 protected static final LogModeType LOG_MODE_EDEFAULT = LogModeType.NONE_LITERAL; 117 118 126 protected LogModeType logMode = LOG_MODE_EDEFAULT; 127 128 135 protected boolean logModeESet = false; 136 137 145 protected static final String NAME_EDEFAULT = null; 146 147 155 protected String name = NAME_EDEFAULT; 156 157 165 protected static final OnErrorContinueType ON_ERROR_CONTINUE_EDEFAULT = OnErrorContinueType.TRUE_LITERAL; 166 167 175 protected OnErrorContinueType onErrorContinue = ON_ERROR_CONTINUE_EDEFAULT; 176 177 184 protected boolean onErrorContinueESet = false; 185 186 194 protected static final String RETURN_CODE_EDEFAULT = null; 195 196 204 protected String returnCode = RETURN_CODE_EDEFAULT; 205 206 211 protected SqlTypeImpl() { 212 super(); 213 } 214 215 220 protected EClass eStaticClass() { 221 return OljPackage.eINSTANCE.getSqlType(); 222 } 223 224 229 public JdbcTargetParametersType getJdbcTargetParameters() { 230 return jdbcTargetParameters; 231 } 232 233 238 public NotificationChain basicSetJdbcTargetParameters(JdbcTargetParametersType newJdbcTargetParameters, NotificationChain msgs) { 239 JdbcTargetParametersType oldJdbcTargetParameters = jdbcTargetParameters; 240 jdbcTargetParameters = newJdbcTargetParameters; 241 if (eNotificationRequired()) { 242 ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OljPackage.SQL_TYPE__JDBC_TARGET_PARAMETERS, oldJdbcTargetParameters, newJdbcTargetParameters); 243 if (msgs == null) msgs = notification; else msgs.add(notification); 244 } 245 return msgs; 246 } 247 248 253 public void setJdbcTargetParameters(JdbcTargetParametersType newJdbcTargetParameters) { 254 if (newJdbcTargetParameters != jdbcTargetParameters) { 255 NotificationChain msgs = null; 256 if (jdbcTargetParameters != null) 257 msgs = ((InternalEObject)jdbcTargetParameters).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OljPackage.SQL_TYPE__JDBC_TARGET_PARAMETERS, null, msgs); 258 if (newJdbcTargetParameters != null) 259 msgs = ((InternalEObject)newJdbcTargetParameters).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OljPackage.SQL_TYPE__JDBC_TARGET_PARAMETERS, null, msgs); 260 msgs = basicSetJdbcTargetParameters(newJdbcTargetParameters, msgs); 261 if (msgs != null) msgs.dispatch(); 262 } 263 else if (eNotificationRequired()) 264 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SQL_TYPE__JDBC_TARGET_PARAMETERS, newJdbcTargetParameters, newJdbcTargetParameters)); 265 } 266 267 272 public IncludeType getInclude() { 273 return include; 274 } 275 276 281 public NotificationChain basicSetInclude(IncludeType newInclude, NotificationChain msgs) { 282 IncludeType oldInclude = include; 283 include = newInclude; 284 if (eNotificationRequired()) { 285 ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OljPackage.SQL_TYPE__INCLUDE, oldInclude, newInclude); 286 if (msgs == null) msgs = notification; else msgs.add(notification); 287 } 288 return msgs; 289 } 290 291 296 public void setInclude(IncludeType newInclude) { 297 if (newInclude != include) { 298 NotificationChain msgs = null; 299 if (include != null) 300 msgs = ((InternalEObject)include).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OljPackage.SQL_TYPE__INCLUDE, null, msgs); 301 if (newInclude != null) 302 msgs = ((InternalEObject)newInclude).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OljPackage.SQL_TYPE__INCLUDE, null, msgs); 303 msgs = basicSetInclude(newInclude, msgs); 304 if (msgs != null) msgs.dispatch(); 305 } 306 else if (eNotificationRequired()) 307 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SQL_TYPE__INCLUDE, newInclude, newInclude)); 308 } 309 310 315 public SqlStmtType getSqlStmt() { 316 return sqlStmt; 317 } 318 319 324 public NotificationChain basicSetSqlStmt(SqlStmtType newSqlStmt, NotificationChain msgs) { 325 SqlStmtType oldSqlStmt = sqlStmt; 326 sqlStmt = newSqlStmt; 327 if (eNotificationRequired()) { 328 ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, OljPackage.SQL_TYPE__SQL_STMT, oldSqlStmt, newSqlStmt); 329 if (msgs == null) msgs = notification; else msgs.add(notification); 330 } 331 return msgs; 332 } 333 334 339 public void setSqlStmt(SqlStmtType newSqlStmt) { 340 if (newSqlStmt != sqlStmt) { 341 NotificationChain msgs = null; 342 if (sqlStmt != null) 343 msgs = ((InternalEObject)sqlStmt).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - OljPackage.SQL_TYPE__SQL_STMT, null, msgs); 344 if (newSqlStmt != null) 345 msgs = ((InternalEObject)newSqlStmt).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - OljPackage.SQL_TYPE__SQL_STMT, null, msgs); 346 msgs = basicSetSqlStmt(newSqlStmt, msgs); 347 if (msgs != null) msgs.dispatch(); 348 } 349 else if (eNotificationRequired()) 350 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SQL_TYPE__SQL_STMT, newSqlStmt, newSqlStmt)); 351 } 352 353 358 public CommitType getCommit() { 359 return commit; 360 } 361 362 367 public void setCommit(CommitType newCommit) { 368 CommitType oldCommit = commit; 369 commit = newCommit == null ? COMMIT_EDEFAULT : newCommit; 370 boolean oldCommitESet = commitESet; 371 commitESet = true; 372 if (eNotificationRequired()) 373 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SQL_TYPE__COMMIT, oldCommit, commit, !oldCommitESet)); 374 } 375 376 381 public void unsetCommit() { 382 CommitType oldCommit = commit; 383 boolean oldCommitESet = commitESet; 384 commit = COMMIT_EDEFAULT; 385 commitESet = false; 386 if (eNotificationRequired()) 387 eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.SQL_TYPE__COMMIT, oldCommit, COMMIT_EDEFAULT, oldCommitESet)); 388 } 389 390 395 public boolean isSetCommit() { 396 return commitESet; 397 } 398 399 404 public LogModeType getLogMode() { 405 return logMode; 406 } 407 408 413 public void setLogMode(LogModeType newLogMode) { 414 LogModeType oldLogMode = logMode; 415 logMode = newLogMode == null ? LOG_MODE_EDEFAULT : newLogMode; 416 boolean oldLogModeESet = logModeESet; 417 logModeESet = true; 418 if (eNotificationRequired()) 419 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SQL_TYPE__LOG_MODE, oldLogMode, logMode, !oldLogModeESet)); 420 } 421 422 427 public void unsetLogMode() { 428 LogModeType oldLogMode = logMode; 429 boolean oldLogModeESet = logModeESet; 430 logMode = LOG_MODE_EDEFAULT; 431 logModeESet = false; 432 if (eNotificationRequired()) 433 eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.SQL_TYPE__LOG_MODE, oldLogMode, LOG_MODE_EDEFAULT, oldLogModeESet)); 434 } 435 436 441 public boolean isSetLogMode() { 442 return logModeESet; 443 } 444 445 450 public String getName() { 451 return name; 452 } 453 454 459 public void setName(String newName) { 460 String oldName = name; 461 name = newName; 462 if (eNotificationRequired()) 463 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SQL_TYPE__NAME, oldName, name)); 464 } 465 466 471 public OnErrorContinueType getOnErrorContinue() { 472 return onErrorContinue; 473 } 474 475 480 public void setOnErrorContinue(OnErrorContinueType newOnErrorContinue) { 481 OnErrorContinueType oldOnErrorContinue = onErrorContinue; 482 onErrorContinue = newOnErrorContinue == null ? ON_ERROR_CONTINUE_EDEFAULT : newOnErrorContinue; 483 boolean oldOnErrorContinueESet = onErrorContinueESet; 484 onErrorContinueESet = true; 485 if (eNotificationRequired()) 486 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SQL_TYPE__ON_ERROR_CONTINUE, oldOnErrorContinue, onErrorContinue, !oldOnErrorContinueESet)); 487 } 488 489 494 public void unsetOnErrorContinue() { 495 OnErrorContinueType oldOnErrorContinue = onErrorContinue; 496 boolean oldOnErrorContinueESet = onErrorContinueESet; 497 onErrorContinue = ON_ERROR_CONTINUE_EDEFAULT; 498 onErrorContinueESet = false; 499 if (eNotificationRequired()) 500 eNotify(new ENotificationImpl(this, Notification.UNSET, OljPackage.SQL_TYPE__ON_ERROR_CONTINUE, oldOnErrorContinue, ON_ERROR_CONTINUE_EDEFAULT, oldOnErrorContinueESet)); 501 } 502 503 508 public boolean isSetOnErrorContinue() { 509 return onErrorContinueESet; 510 } 511 512 517 public String getReturnCode() { 518 return returnCode; 519 } 520 521 526 public void setReturnCode(String newReturnCode) { 527 String oldReturnCode = returnCode; 528 returnCode = newReturnCode; 529 if (eNotificationRequired()) 530 eNotify(new ENotificationImpl(this, Notification.SET, OljPackage.SQL_TYPE__RETURN_CODE, oldReturnCode, returnCode)); 531 } 532 533 538 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, Class baseClass, NotificationChain msgs) { 539 if (featureID >= 0) { 540 switch (eDerivedStructuralFeatureID(featureID, baseClass)) { 541 case OljPackage.SQL_TYPE__JDBC_TARGET_PARAMETERS: 542 return basicSetJdbcTargetParameters(null, msgs); 543 case OljPackage.SQL_TYPE__INCLUDE: 544 return basicSetInclude(null, msgs); 545 case OljPackage.SQL_TYPE__SQL_STMT: 546 return basicSetSqlStmt(null, msgs); 547 default: 548 return eDynamicInverseRemove(otherEnd, featureID, baseClass, msgs); 549 } 550 } 551 return eBasicSetContainer(null, featureID, msgs); 552 } 553 554 559 public Object eGet(EStructuralFeature eFeature, boolean resolve) { 560 switch (eDerivedStructuralFeatureID(eFeature)) { 561 case OljPackage.SQL_TYPE__JDBC_TARGET_PARAMETERS: 562 return getJdbcTargetParameters(); 563 case OljPackage.SQL_TYPE__INCLUDE: 564 return getInclude(); 565 case OljPackage.SQL_TYPE__SQL_STMT: 566 return getSqlStmt(); 567 case OljPackage.SQL_TYPE__COMMIT: 568 return getCommit(); 569 case OljPackage.SQL_TYPE__LOG_MODE: 570 return getLogMode(); 571 case OljPackage.SQL_TYPE__NAME: 572 return getName(); 573 case OljPackage.SQL_TYPE__ON_ERROR_CONTINUE: 574 return getOnErrorContinue(); 575 case OljPackage.SQL_TYPE__RETURN_CODE: 576 return getReturnCode(); 577 } 578 return eDynamicGet(eFeature, resolve); 579 } 580 581 586 public void eSet(EStructuralFeature eFeature, Object newValue) { 587 switch (eDerivedStructuralFeatureID(eFeature)) { 588 case OljPackage.SQL_TYPE__JDBC_TARGET_PARAMETERS: 589 setJdbcTargetParameters((JdbcTargetParametersType)newValue); 590 return; 591 case OljPackage.SQL_TYPE__INCLUDE: 592 setInclude((IncludeType)newValue); 593 return; 594 case OljPackage.SQL_TYPE__SQL_STMT: 595 setSqlStmt((SqlStmtType)newValue); 596 return; 597 case OljPackage.SQL_TYPE__COMMIT: 598 setCommit((CommitType)newValue); 599 return; 600 case OljPackage.SQL_TYPE__LOG_MODE: 601 setLogMode((LogModeType)newValue); 602 return; 603 case OljPackage.SQL_TYPE__NAME: 604 setName((String )newValue); 605 return; 606 case OljPackage.SQL_TYPE__ON_ERROR_CONTINUE: 607 setOnErrorContinue((OnErrorContinueType)newValue); 608 return; 609 case OljPackage.SQL_TYPE__RETURN_CODE: 610 setReturnCode((String )newValue); 611 return; 612 } 613 eDynamicSet(eFeature, newValue); 614 } 615 616 621 public void eUnset(EStructuralFeature eFeature) { 622 switch (eDerivedStructuralFeatureID(eFeature)) { 623 case OljPackage.SQL_TYPE__JDBC_TARGET_PARAMETERS: 624 setJdbcTargetParameters((JdbcTargetParametersType)null); 625 return; 626 case OljPackage.SQL_TYPE__INCLUDE: 627 setInclude((IncludeType)null); 628 return; 629 case OljPackage.SQL_TYPE__SQL_STMT: 630 setSqlStmt((SqlStmtType)null); 631 return; 632 case OljPackage.SQL_TYPE__COMMIT: 633 unsetCommit(); 634 return; 635 case OljPackage.SQL_TYPE__LOG_MODE: 636 unsetLogMode(); 637 return; 638 case OljPackage.SQL_TYPE__NAME: 639 setName(NAME_EDEFAULT); 640 return; 641 case OljPackage.SQL_TYPE__ON_ERROR_CONTINUE: 642 unsetOnErrorContinue(); 643 return; 644 case OljPackage.SQL_TYPE__RETURN_CODE: 645 setReturnCode(RETURN_CODE_EDEFAULT); 646 return; 647 } 648 eDynamicUnset(eFeature); 649 } 650 651 656 public boolean eIsSet(EStructuralFeature eFeature) { 657 switch (eDerivedStructuralFeatureID(eFeature)) { 658 case OljPackage.SQL_TYPE__JDBC_TARGET_PARAMETERS: 659 return jdbcTargetParameters != null; 660 case OljPackage.SQL_TYPE__INCLUDE: 661 return include != null; 662 case OljPackage.SQL_TYPE__SQL_STMT: 663 return sqlStmt != null; 664 case OljPackage.SQL_TYPE__COMMIT: 665 return isSetCommit(); 666 case OljPackage.SQL_TYPE__LOG_MODE: 667 return isSetLogMode(); 668 case OljPackage.SQL_TYPE__NAME: 669 return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); 670 case OljPackage.SQL_TYPE__ON_ERROR_CONTINUE: 671 return isSetOnErrorContinue(); 672 case OljPackage.SQL_TYPE__RETURN_CODE: 673 return RETURN_CODE_EDEFAULT == null ? returnCode != null : !RETURN_CODE_EDEFAULT.equals(returnCode); 674 } 675 return eDynamicIsSet(eFeature); 676 } 677 678 683 public String toString() { 684 if (eIsProxy()) return super.toString(); 685 686 StringBuffer result = new StringBuffer (super.toString()); 687 result.append(" (commit: "); 688 if (commitESet) result.append(commit); else result.append("<unset>"); 689 result.append(", logMode: "); 690 if (logModeESet) result.append(logMode); else result.append("<unset>"); 691 result.append(", name: "); 692 result.append(name); 693 result.append(", onErrorContinue: "); 694 if (onErrorContinueESet) result.append(onErrorContinue); else result.append("<unset>"); 695 result.append(", returnCode: "); 696 result.append(returnCode); 697 result.append(')'); 698 return result.toString(); 699 } 700 701 } | Popular Tags |