1 package com.daffodilwoods.daffodildb.server.sql99.dql.tableexpression.fromclause; 2 3 import java.util.*; 4 5 import com.daffodilwoods.daffodildb.server.datadictionarysystem.*; 6 import com.daffodilwoods.daffodildb.server.serversystem.*; 7 import com.daffodilwoods.daffodildb.server.sql99.common.*; 8 import com.daffodilwoods.daffodildb.server.sql99.dql.common.*; 9 import com.daffodilwoods.daffodildb.server.sql99.dql.execution.*; 10 import com.daffodilwoods.daffodildb.server.sql99.dql.listenerevents.*; 11 import com.daffodilwoods.daffodildb.server.sql99.dql.plan.*; 12 import com.daffodilwoods.daffodildb.server.sql99.dql.plan.condition.*; 13 import com.daffodilwoods.daffodildb.server.sql99.dql.plan.order.*; 14 import com.daffodilwoods.daffodildb.server.sql99.dql.plan.table.*; 15 import com.daffodilwoods.daffodildb.server.sql99.dql.queryexpression.*; 16 import com.daffodilwoods.daffodildb.server.sql99.dql.semanticchecker.*; 17 import com.daffodilwoods.daffodildb.server.sql99.expression.booleanvalueexpression.*; 18 import com.daffodilwoods.daffodildb.server.sql99.token.*; 19 import com.daffodilwoods.daffodildb.server.sql99.utils.*; 20 import com.daffodilwoods.daffodildb.utils.parser.*; 21 import com.daffodilwoods.database.resource.*; 22 import com.daffodilwoods.database.sqlinitiator.*; 23 import com.daffodilwoods.database.utility.P; 24 import com.daffodilwoods.daffodildb.server.sql99.expression.expressionprimary.subquery; 25 import com.daffodilwoods.daffodildb.server.sql99.common.ColumnDetails; 26 import com.daffodilwoods.daffodildb.server.sql99.dql.resultsetmetadata.*; 27 28 50 public class qualifiedjoin implements com.daffodilwoods.daffodildb.utils.parser.StatementExecuter, joinedtable, Datatypes, TypeConstants, queryexpressionbody, non_joinqueryterm, tablereference { 51 52 55 public joinspecification _joinspecification0; 56 57 60 public tablereference _tablereference1; 61 62 65 public SRESERVEDWORD1206543922 _SRESERVEDWORD12065439222; 66 67 74 public jointype _Optjointype3; 75 76 79 public tablereference _tablereference4; 80 81 84 private TableDetails[] tableDetails; 85 86 89 private TableDetails[] table2; 90 91 94 private TableDetails[] table1; 95 96 100 101 private TableDetails[] allTableDetailsLeft; 102 103 107 108 private TableDetails[] allTableDetailsRight; 109 110 114 private TableDetails[] ALLTABLEDETAILS; 115 116 119 private _Reference[] thisQueryReferences; 120 121 private _Reference[] underlyingRef; 122 123 private _Reference[] refs_Condition; 124 125 128 129 private int joinType = -1; 130 131 public qualifiedjoin() { 132 } 133 134 public qualifiedjoin(joinspecification joinCondition, 135 tablereference tableReference1, 136 tablereference tableReference2, jointype joinType0, 137 TableDetails[] table10, TableDetails[] table20, int type) throws 138 DException { 139 _joinspecification0 = joinCondition; 140 _tablereference4 = tableReference1; 141 _tablereference1 = tableReference2; 142 _Optjointype3 = joinType0; 143 _SRESERVEDWORD12065439222 = new SRESERVEDWORD1206543922(); 144 _SRESERVEDWORD12065439222._SRESERVEDWORD12065439220 = " JOIN "; 145 table1 = table10; 146 table2 = table20; 147 tableDetails=GeneralPurposeStaticClass.getJointTableDetails(table1,table2); 148 joinType = type; 149 getColumnDetails(); 150 } 151 152 163 private void addJoinCondition(ConditionArray conditionArray) throws DException { 164 _BVEPlan bvePlan = _joinspecification0.getBveExecutionPlan(); 165 addJoinCondition(conditionArray, bvePlan); 166 } 167 168 176 private void addJoinCondition(ConditionArray conditionArray, _BVEPlan onConditionPlan) throws DException { 177 _BVESingleTablePlan[] bveSingleTablePlans = onConditionPlan.getBVESingleTablePlans(); 178 if (bveSingleTablePlans != null) { 179 for (int i = 0; i < bveSingleTablePlans.length; i++) { 180 conditionArray.addCondition(bveSingleTablePlans[i].getCondition()); 181 } 182 } 183 _AllTablesJoinRelation allTablesJoinRelation = onConditionPlan.getAllTableJoinRelation(); 184 if (allTablesJoinRelation != null) { 185 _JoinRelation[] joinRelations = allTablesJoinRelation.getRelations(); 186 for (int i = 0; i < joinRelations.length; i++) { 187 conditionArray.addCondition(joinRelations[i].getCondition()); 188 189 } 190 } 191 } 192 193 224 public _TablePlan[] getTablePlans(_ServerSession serverSession, _DatedFramework datedFrameWork, _BVEPlan bvePlan0, _OrderPlan orderPlan0, _QueryColumns queryColumns0, ConditionArray conditionArray) throws DException { 225 initializeAppropriateJoinType(conditionArray, serverSession); 226 if (joinType == INNERJOIN || joinType == JOIN) { 227 return getTablePlansInSimpleJoin(serverSession, datedFrameWork, bvePlan0, orderPlan0, queryColumns0, conditionArray); 228 } 229 if (joinType == FULL_OUTER_JOIN) { 230 return getTablePLanForFOJ(serverSession, datedFrameWork, bvePlan0, orderPlan0, queryColumns0, conditionArray); 231 } 232 return getTablePlanForLOJOrROJModified(serverSession, datedFrameWork, bvePlan0, orderPlan0, queryColumns0, conditionArray); 233 } 234 235 262 private _TablePlan[] getTablePLanForFOJ(_ServerSession serverSession, _DatedFramework datedFrameWork, _BVEPlan bvePlan0, _OrderPlan orderPlan0, _QueryColumns queryColumns0, ConditionArray conditionArray) throws DException { 263 ConditionArray condArray = getClonedConditionArray(conditionArray); 264 _BVEPlan bvePlanClone = (_BVEPlan) ( (BVEAllTablePlan) bvePlan0).clone(); 265 adjustNullPredicateForFullOuterJoinModified(bvePlan0); 266 267 _TablePlan tablePlans1[] = _tablereference4.getTablePlan(serverSession, datedFrameWork, bvePlan0, orderPlan0, queryColumns0, conditionArray); 268 _TablePlan tablePlans2[] = _tablereference1.getTablePlan(serverSession, datedFrameWork, bvePlan0, orderPlan0, queryColumns0, conditionArray); 269 _TablePlan tPlans[] = initializeNestedLoopJoinPlanIfAny(tablePlans1, tablePlans2); 270 joinType = LEFT_OUTER_JOIN; 271 272 _QualifiedPlan qualifiedLeftPlan = (_QualifiedPlan) getTablePlanForLOJOrROJModified(serverSession, datedFrameWork, bvePlanClone, orderPlan0, queryColumns0, condArray)[0]; 273 joinType = FULL_OUTER_JOIN; 274 QualifiedFullPlan qpa=new QualifiedFullPlan(tPlans[0], tPlans[1], _joinspecification0.getWholeCondition(), qualifiedLeftPlan, serverSession); 275 276 277 _QualifiedBVE qualifiedBVE= _joinspecification0.getQualifiedBVE(GeneralPurposeStaticClass.getJointTableDetails(_tablereference1.getTableDetails(serverSession, null),_tablereference4.getTableDetails(serverSession, null))); 278 booleanvalueexpression bve1=qualifiedBVE.getOnCondition(); 279 if(bve1!=null){ 280 underlyingRef=GeneralPurposeStaticClass.getUnderLyingReferencesOnly(GeneralPurposeStaticClass.getAllReferences(bve1.getReferences(tableDetails)),tableDetails ); 281 } 282 283 284 underlyingRef=GeneralPurposeStaticClass.getJointReferences(underlyingRef,refs_Condition); 285 286 287 288 if(underlyingRef!=null){ 289 qpa.setUnderLyingRefernce(underlyingRef); 290 } 291 return new _TablePlan[]{qpa}; 292 } 293 294 301 302 private void adjustNullPredicateForFullOuterJoinModified(_BVEPlan bvePlan0) throws DException { 303 adjustNullPredicateModified(bvePlan0, table2); 304 adjustNullPredicateModified(bvePlan0, table1); 305 } 306 307 345 private _TablePlan[] getTablePlanForLOJOrROJModified(_ServerSession serverSession, _DatedFramework datedFrameWork, _BVEPlan bvePlan0, _OrderPlan orderPlan0, _QueryColumns queryColumns0, ConditionArray conditionArray) throws DException { 346 tablereference tableReferenceLeft = _tablereference4; 347 tablereference tableReferenceRight = _tablereference1; 348 if (joinType == RIGHT_OUTER_JOIN) { 349 tableReferenceLeft = _tablereference1; 350 tableReferenceRight = _tablereference4; 351 } 352 TableDetails[] table = tableReferenceRight.getTableDetails(serverSession, null); 353 _QualifiedBVE qualifiedBVE = null; 354 qualifiedBVE = _joinspecification0.getQualifiedBVE(table); 355 356 adjustNullPredicateModified(bvePlan0, table); 357 mergeSingleTableLevelCOnditionsOfQualified(qualifiedBVE, bvePlan0); 358 _TablePlan[] tablePlansLeft = tableReferenceLeft.getTablePlan(serverSession, datedFrameWork, bvePlan0, orderPlan0, queryColumns0, conditionArray); 359 addJoinCondition(conditionArray); 360 _TablePlan[] tablePlansRight = tableReferenceRight.getTablePlan(serverSession, datedFrameWork, bvePlan0, orderPlan0, queryColumns0, conditionArray); 361 _TablePlan[] newPlans = initializeNestedLoopJoinPlanIfAny(tablePlansLeft, tablePlansRight); 362 363 QualifiedLeftPlan qla=new QualifiedLeftPlan(newPlans[0], newPlans[1], qualifiedBVE.getOnCondition()); 364 365 366 booleanvalueexpression bve=qualifiedBVE.getOnCondition(); 367 if(bve!=null){ 368 underlyingRef=GeneralPurposeStaticClass.getUnderLyingReferencesOnly(GeneralPurposeStaticClass.getAllReferences(bve.getReferences(tableDetails)),tableDetails ); 369 } 370 371 372 underlyingRef=GeneralPurposeStaticClass.getJointReferences(underlyingRef,refs_Condition); 373 374 375 376 if(underlyingRef!=null){ 377 qla.setUnderLyingRefernce(underlyingRef); 378 } 379 return new _TablePlan[] {qla}; 380 381 } 382 383 390 391 private void mergeSingleTableLevelCOnditionsOfQualified(_QualifiedBVE qualifiedBVE, _BVEPlan bvePlan0) throws DException { 392 _BVESingleTablePlan bveSingleTablePlans[] = qualifiedBVE.getBVESingleTablePlans(); 393 if (bveSingleTablePlans != null) { 394 for (int i = 0; i < bveSingleTablePlans.length; i++) { 395 BVEPlanMerger.mergeTablePlansWithAnd(bvePlan0, (_BVEPlan) bveSingleTablePlans[i]); 396 } 397 } 398 } 399 400 408 private void adjustNullPredicateModified(_BVEPlan bvePlan0, TableDetails[] table) throws DException { 409 if (bvePlan0 == null) { 410 return; 411 } 412 _BVESingleTablePlan[] bvePlans = bvePlan0.getBVESingleTablePlans(); 413 if (bvePlans == null) { 414 return; 415 } 416 ArrayList bveStp = new ArrayList(); 417 for (int i = 0; i < bvePlans.length; i++) { 418 booleanvalueexpression condition = bvePlans[i].getCondition(); 419 if (condition.isNullPredicate()) { 420 TableDetails bveTD = bvePlans[i].getTableDetails()[0]; 421 if (checkIfExistinTableDetails(bveTD, table)) { 422 bvePlan0.setRemainingCondition(condition); 423 } else { 424 bveStp.add(bvePlans[i]); 425 } 426 } else { 427 bveStp.add(bvePlans[i]); 428 } 429 430 } 431 ( (BVEAllTablePlan) bvePlan0).setBVESingleTablePlans( (_BVESingleTablePlan[]) bveStp.toArray(new _BVESingleTablePlan[bveStp.size()])); 432 } 433 449 private _TablePlan[] initializeNestedLoopJoinPlanIfAny(_TablePlan[] tablePlansLeft, _TablePlan[] tablePlansRight) throws DException { 450 _TablePlan[] newPlans = new _TablePlan[2]; 451 newPlans[0] = tablePlansLeft.length == 1 ? tablePlansLeft[0] : new NestedLoopJoinPlan(tablePlansLeft); 452 newPlans[1] = tablePlansRight.length == 1 ? tablePlansRight[0] : new NestedLoopJoinPlan(tablePlansRight); 453 return newPlans; 454 } 455 456 469 private _TablePlan[] getTablePlansInSimpleJoin(_ServerSession serverSession, _DatedFramework datedFrameWork, _BVEPlan bvePlan0, _OrderPlan orderPlan0, _QueryColumns queryColumns0, ConditionArray conditionArray) throws DException { 470 _BVEPlan onConditionPlan = _joinspecification0.getBveExecutionPlan(); 471 addJoinCondition(conditionArray, onConditionPlan); 473 477 booleanvalueexpression bve=null; 478 if(onConditionPlan.getType()==BVEConstants.BVEALLTABLEPLAN){ 479 480 _QualifiedBVE qualifiedBVE= _joinspecification0.getQualifiedBVE(GeneralPurposeStaticClass.getJointTableDetails(_tablereference1.getTableDetails(serverSession, null),_tablereference4.getTableDetails(serverSession, null))); 481 booleanvalueexpression bve1=qualifiedBVE.getOnCondition(); 482 if(bve1!=null){ 483 underlyingRef=GeneralPurposeStaticClass.getUnderLyingReferencesOnly(GeneralPurposeStaticClass.getAllReferences(bve1.getReferences(tableDetails)),tableDetails ); 484 } 485 486 487 underlyingRef=GeneralPurposeStaticClass.getJointReferences(underlyingRef,refs_Condition); 488 489 490 491 if(underlyingRef!=null ){ 492 bve=onConditionPlan.getRemainingCondition(); 493 onConditionPlan.setRemainingCondition(null); 494 } 495 } 496 497 BVEPlanMerger.mergeTablePlansWithAnd(bvePlan0, onConditionPlan); 498 _TablePlan tablePlan1[] = _tablereference4.getTablePlans(serverSession, datedFrameWork, bvePlan0, orderPlan0, queryColumns0, conditionArray); 499 _TablePlan tablePlan2[] = _tablereference1.getTablePlans(serverSession, datedFrameWork, bvePlan0, orderPlan0, queryColumns0, conditionArray); 500 501 _TablePlan[] tp=concatTablePlans(tablePlan1, tablePlan2); 502 return underlyingRef == null ? tp : new _TablePlan[]{new NestedLoopJoinPlan(tp,bve,underlyingRef)}; 503 } 504 505 512 private _TablePlan[] concatTablePlans(_TablePlan[] tablePlan1, _TablePlan[] tablePlan2) throws DException { 513 int tablePlan1Length = tablePlan1.length; 514 int tablePlan2Length = tablePlan2.length; 515 _TablePlan[] tPlans = new _TablePlan[tablePlan1Length + tablePlan2Length]; 516 System.arraycopy(tablePlan1, 0, tPlans, 0, tablePlan1Length); 517 System.arraycopy(tablePlan2, 0, tPlans, tablePlan1Length, tablePlan2Length); 518 return tPlans; 519 } 520 521 527 528 private ConditionArray getClonedConditionArray(ConditionArray conditionArray) throws DException { 529 try { 530 return (ConditionArray) conditionArray.clone(); 531 } catch (CloneNotSupportedException ex) { 532 } 533 throw new DException("DSE0", new Object [] {"Clone of ConditionArray is Not Successfull"}); 534 } 535 536 547 public _TablePlan[] getTablePlan(_ServerSession serverSession, _DatedFramework datedFramWork, _BVEPlan bvePlan0, _OrderPlan orderPlan0, _QueryColumns queryColumns0, ConditionArray conditionArray) throws DException { 548 return getTablePlans(serverSession, datedFramWork, bvePlan0, orderPlan0, queryColumns0, conditionArray); 549 } 550 551 558 559 private boolean containsTD(TableDetails[] source, TableDetails[] target) throws DException { 560 if (source == null || target == null) { 561 return false; 562 } 563 for (int i = 0; i < source.length; i++) { 564 for (int j = 0; j < target.length; j++) { 565 if (target[j] == source[i]) { 566 return true; 567 } 568 } 569 } 570 return false; 571 } 572 573 579 private boolean checkIfExistinTableDetails(TableDetails bveTable, TableDetails table[]) { 580 for (int i = 0; i < table.length; i++) { 581 if (bveTable == table[i]) { 582 return true; 583 } 584 } 585 return false; 586 } 587 588 607 public _Reference[] checkSemantic(com.daffodilwoods.daffodildb.server.serversystem._ServerSession parent, ColumnDetails[] queryColumns, boolean checkUserRight) throws DException { 608 ColumnDetails[] result = _joinspecification0.getColumnDetails(); 609 610 611 TableDetails td[]=getTableDetails(parent,null); 612 refs_Condition=_joinspecification0.getWholeCondition().getReferences(td); 613 refs_Condition = getReferencesRelatedtoJoin(td,parent); 614 615 616 ArrayList list = new ArrayList(); 617 _Reference[] reference1 = _tablereference4.checkSemantic(parent, queryColumns, checkUserRight); 618 _Reference[] reference2 = _tablereference1.checkSemantic(parent, queryColumns, checkUserRight); 619 _Reference[] reference3 = GeneralPurposeStaticClass.getJointReferences(reference1, reference2); 620 SetColumnProperties.setTableNamesAndDatatypesOfAllColumns(parent, result, tableDetails, list, new ArrayList()); if (!list.isEmpty()) { 622 thisQueryReferences = (_Reference[]) list.toArray(new _Reference[list.size()]); 623 initializingTypeOfUnKnownReferencesAsConstant(thisQueryReferences); 624 } 625 reference3 = GeneralPurposeStaticClass.getJointReferences(reference3, _joinspecification0.checkSemantic(parent, checkUserRight)); 626 627 return reference3; 628 } 629 630 640 private void initializingTypeOfUnKnownReferencesAsConstant(_Reference[] unKnownReferences) throws DException { 641 for (int i = 0, length = unKnownReferences.length; i < length; ++i) { 642 if ( ( (ColumnDetails) unKnownReferences[i]).getType() == REFERENCE) { 643 ( (ColumnDetails) unKnownReferences[i]).setUnderLyingReference(true); 644 ( (ColumnDetails) unKnownReferences[i]).setType(CONSTANT); 645 } 646 } 647 } 648 649 652 653 public Object run(Object object) throws com.daffodilwoods.database.resource.DException { 654 throw new DException("DSE16", new Object [] {"run"}); 655 } 656 657 666 667 private int getMyType() throws DException { 668 if (this.joinType == -1) { 669 String joinType = ""; 670 if (_Optjointype3 != null) { 671 joinType = (String ) _Optjointype3.run(null); 672 } 673 joinType += SqlKeywords.JOIN; 674 joinType = joinType.trim(); 675 if (joinType.equalsIgnoreCase(SqlKeywords.INNERJOIN)) { 676 this.joinType = INNERJOIN; 677 } else if (joinType.equalsIgnoreCase(SqlKeywords.LEFTOUTERJOIN)) { 678 this.joinType = LEFT_OUTER_JOIN; 679 } else if (joinType.equalsIgnoreCase(SqlKeywords.LEFTJOIN)) { 680 this.joinType = LEFT_OUTER_JOIN; 681 } else if (joinType.equalsIgnoreCase(SqlKeywords.RIGHTOUTERJOIN)) { 682 this.joinType = RIGHT_OUTER_JOIN; 683 } else if (joinType.equalsIgnoreCase(SqlKeywords.RIGHTJOIN)) { 684 this.joinType = RIGHT_OUTER_JOIN; 685 } else if (joinType.equalsIgnoreCase(SqlKeywords.FULLOUTERJOIN)) { 686 this.joinType = FULL_OUTER_JOIN; 687 } else if (joinType.equalsIgnoreCase(SqlKeywords.FULLJOIN)) { 688 this.joinType = FULL_OUTER_JOIN; 689 } else if (joinType.equalsIgnoreCase(SqlKeywords.JOIN)) { 690 this.joinType = INNERJOIN; 691 } else { 692 this.joinType = INNERJOIN; 693 } 694 695 } 696 return this.joinType; 697 } 698 699 702 703 704 705 715 public TableDetails[] getTableDetails(com.daffodilwoods.daffodildb.server.serversystem._ServerSession serverSession, ColumnDetails[] queryColumns) throws DException { 716 if (tableDetails == null) { 717 getMyType(); 718 table1 = _tablereference4.getTableDetails(serverSession, queryColumns); 719 table2 = _tablereference1.getTableDetails(serverSession, queryColumns); 720 721 TableDetails[] result = new TableDetails[table1.length + table2.length]; 722 if (joinType == LEFT_OUTER_JOIN) { 723 table2[0].setHasRecord(true); 724 } else if (joinType == RIGHT_OUTER_JOIN) { 725 table1[0].setHasRecord(true); 726 } 727 int i; 728 for (i = 0; i < table1.length; i++) { 729 result[i] = table1[i]; 730 } 731 for (int j = 0; j < table2.length; j++, i++) { 732 result[i] = table2[j]; 733 } 734 tableDetails = result; 735 } 736 return tableDetails; 737 } 738 739 746 public ColumnDetails[] getColumnDetails() throws DException { 747 ColumnDetails[] columnDetails1 = _tablereference4.getColumnDetails(); 748 ColumnDetails[] columnDetails2 = _tablereference1.getColumnDetails(); 749 columnDetails1 = SemanticChecker.addColumnDetails(columnDetails1, columnDetails2); 750 return SemanticChecker.addColumnDetails(columnDetails1, _joinspecification0.getColumnDetails()); 751 } 752 753 759 public void getColumnsIncluded(ArrayList aList) throws DException { 760 _tablereference1.getColumnsIncluded(aList); 761 _tablereference4.getColumnsIncluded(aList); 762 _joinspecification0.getColumnsIncluded(aList); 763 } 764 765 public void getTablesIncluded(ArrayList aList) throws DException { 766 _tablereference1.getTablesIncluded(aList); 767 _tablereference4.getTablesIncluded(aList); 768 _joinspecification0.getTablesIncluded(aList); 769 } 770 771 777 public ParameterInfo[] getParameterInfo() throws DException { 778 ParameterInfo[] parameterInfo1 = _tablereference4.getParameterInfo(); 779 ParameterInfo[] parameterInfo2 = _tablereference1.getParameterInfo(); 780 ParameterInfo[] parameterInfo3 = _joinspecification0.getParameterInfo(); 781 ArrayList result = new ArrayList(); 782 if (parameterInfo1 != null) { 783 result.addAll(Arrays.asList(parameterInfo1)); 784 } 785 if (parameterInfo2 != null) { 786 result.addAll(Arrays.asList(parameterInfo2)); 787 } 788 if (parameterInfo3 != null) { 789 result.addAll(Arrays.asList(parameterInfo3)); 790 791 } 792 return (ParameterInfo[]) result.toArray(new ParameterInfo[result.size()]); 793 } 794 795 802 public Object [] getParameters(Object object) throws DException { 803 ArrayList aList = new ArrayList(); 804 Object [] obj = _tablereference4.getParameters(object); 805 if (obj != null) { 806 aList.addAll(Arrays.asList(obj)); 807 } 808 obj = _tablereference1.getParameters(object); 809 if (obj != null) { 810 aList.addAll(Arrays.asList(obj)); 811 } 812 obj = _joinspecification0.getParameters(object); 813 if (obj != null) { 814 aList.addAll(Arrays.asList(obj)); 815 } 816 int size = aList.size(); 817 return size == 0 ? null : aList.toArray(new Object [size]); 818 } 819 820 827 828 public _Reference[] getUnderlyingReferences() throws DException { 829 _Reference[] references = GeneralPurposeStaticClass.getJointReferences( 830 _tablereference4.getUnderlyingReferences(), 831 _tablereference1.getUnderlyingReferences()); 832 return GeneralPurposeStaticClass.getJointReferences(thisQueryReferences, 833 references); 834 } 835 836 846 847 public TableDetails[] getTablesForBlankInsert() throws DException { 848 if (joinType == LEFT_OUTER_JOIN) { 849 return _tablereference4.getTablesForBlankInsert(); 850 } else if (joinType == RIGHT_OUTER_JOIN) { 851 return _tablereference1.getTablesForBlankInsert(); 852 } else if (joinType == FULL_OUTER_JOIN || joinType == INNERJOIN) { 853 ArrayList arr = new ArrayList(); 854 arr.addAll(Arrays.asList(_tablereference4.getTablesForBlankInsert())); 855 arr.addAll(Arrays.asList(_tablereference1.getTablesForBlankInsert())); 856 return (TableDetails[]) arr.toArray(new TableDetails[0]); 857 } 858 return null; 859 } 860 861 871 public void setTablesForInsertion(ColumnMappingHandler columnMapping, _VariableValueOperations vv) throws com.daffodilwoods.database.resource.DException { 872 getAllTableDetails(); 873 if (joinType == LEFT_OUTER_JOIN) { 874 if (insertInMapping(allTableDetailsRight, columnMapping, allTableDetailsLeft)) { 875 if (!addTablesForDeletion(columnMapping, allTableDetailsRight[0], _tablereference1)) { 876 _tablereference1.setTablesForInsertion(columnMapping, vv); 877 } 878 } 879 _tablereference4.setTablesForInsertion(columnMapping, vv); } else if (joinType == RIGHT_OUTER_JOIN) { 881 if (insertInMapping(allTableDetailsLeft, columnMapping, allTableDetailsRight)) { 882 if (!addTablesForDeletion(columnMapping, allTableDetailsLeft[0], _tablereference4)) { 883 _tablereference4.setTablesForInsertion(columnMapping, vv); 884 } 885 } 886 _tablereference1.setTablesForInsertion(columnMapping, vv); 887 } else if (joinType == INNERJOIN || joinType == JOIN) { 888 if (!addTablesForDeletion(columnMapping, allTableDetailsRight[0], _tablereference1)) { 889 _tablereference1.setTablesForInsertion(columnMapping, vv); 890 } 891 if (!addTablesForDeletion(columnMapping, allTableDetailsLeft[0], _tablereference4)) { 892 _tablereference4.setTablesForInsertion(columnMapping, vv); 893 } 894 } 895 } 896 897 908 909 private boolean addTablesForDeletion(ColumnMappingHandler cmpHandler, TableDetails td, tablereference tableReference) throws DException { 910 int hasRecordValue = cmpHandler.isHasRecord_False(td); 911 boolean toRet = false; 912 if (hasRecordValue == 0) { 913 toRet = true; 914 TableDetails[] tdd = tableReference.getTablesForBlankInsert(); 915 if (tdd != null) { 916 cmpHandler.addTableForDeletion(tdd); 917 } 918 } 919 return toRet; 920 } 921 922 931 private boolean insertInMapping(TableDetails[] tDetails, ColumnMappingHandler columnMapping, TableDetails[] tdToSendFurther) throws DException { 932 boolean inserted = false; 933 if (columnMapping.isTableInUserTableMapping(tDetails)) { 934 TableDetails[] td = ( (joincondition) _joinspecification0).getJoinCorrespondingTables(tdToSendFurther); 935 if (td != null) { 936 inserted = true; 937 for (int i = 0; i < td.length; i++) { 938 if (!columnMapping.tableAlreadyInsertedForInsert(td[i])) { 939 columnMapping.addTableForInsertion(td[i]); 940 } 941 } 942 } 943 } 944 945 return inserted; 946 } 947 948 956 public _BVEPlan getBveExecutionPlan() throws DException { 957 _BVEPlan bvePlan1 = _tablereference4.getBveExecutionPlan(); 958 _BVEPlan bvePlan2 = _tablereference1.getBveExecutionPlan(); 959 bvePlan1 = BVEPlanMerger.mergeTablePlansWithAnd(bvePlan1, bvePlan2); 960 return bvePlan1; 961 } 962 963 970 public TableDetails[] getAllTableDetails() throws DException { 971 if (ALLTABLEDETAILS == null) { 972 if (allTableDetailsLeft == null) { 973 allTableDetailsLeft = _tablereference4.getAllTableDetails(); 974 } 975 if (allTableDetailsRight == null) { 976 allTableDetailsRight = _tablereference1.getAllTableDetails(); 977 } 978 ALLTABLEDETAILS = GeneralPurposeStaticClass.getJointTableDetails(allTableDetailsLeft, allTableDetailsRight); 979 } 980 return ALLTABLEDETAILS; 981 } 982 983 990 public TableDetails[] getViewTableDetails() throws DException { 991 TableDetails[] td1 = _tablereference4.getViewTableDetails(); 992 TableDetails[] td2 = _tablereference1.getViewTableDetails(); 993 return GeneralPurposeStaticClass.getJointTableDetails(td1, td2); 994 } 995 1001 public QueryProperty getStrings() throws com.daffodilwoods.database.resource.DException { 1002 1003 throw new java.lang.UnsupportedOperationException ("Method getStrings() not yet implemented."); 1004 } 1005 1006 public _TablePlan getExecutionPlan(_ServerSession session, booleanvalueexpression bve, _DatedFramework datedCondition, _Order order, ColumnDetails[] cdsWithActualTableDetails, ConditionArray conditionArray) throws DException { 1007 1008 throw new java.lang.UnsupportedOperationException ("Method getExecutionPlan() not yet implemented."); 1009 } 1010 1011 public void setFKeyColumnDetails(ColumnDetails[] parm1) throws com.daffodilwoods.database.resource.DException { 1012 1013 throw new java.lang.UnsupportedOperationException ("Method setFKeyColumnDetails() not yet implemented."); 1014 } 1015 1016 public ColumnDetails[] getSelectedColumns() throws com.daffodilwoods.database.resource.DException { 1017 1018 throw new java.lang.UnsupportedOperationException ("Method getSelectedColumns() not yet implemented."); 1019 } 1020 1021 public _TablePlan getExecutionPlan(_ServerSession parm1) throws com.daffodilwoods.database.resource.DException { 1022 1023 throw new java.lang.UnsupportedOperationException ("Method getExecutionPlan() not yet implemented."); 1024 } 1025 1026 public _ColumnCharacteristics getColumnCharacteristics(Object parm1) throws com.daffodilwoods.database.resource.DException { 1027 1028 throw new java.lang.UnsupportedOperationException ("Method getColumnCharacteristics() not yet implemented."); 1029 } 1030 1031 1035 public String toString() { 1036 StringBuffer sb = new StringBuffer (); 1037 sb.append(" "); 1038 sb.append(_tablereference4); 1039 sb.append(" "); 1040 if (_Optjointype3 != null) { 1041 sb.append(_Optjointype3); 1042 } 1043 sb.append(" "); 1044 sb.append(_SRESERVEDWORD12065439222); 1045 sb.append(" "); 1046 sb.append(_tablereference1); 1047 sb.append(" "); 1048 sb.append(_joinspecification0); 1049 return sb.toString(); 1050 } 1051 1052 public _Reference[] getReferences(TableDetails[] tableDetails) throws DException { 1053 throw new java.lang.UnsupportedOperationException ("Method getReferences( TableDetails[] ) not yet implemented."); 1054 } 1055 1056 1061 public Object clone() throws CloneNotSupportedException { 1062 qualifiedjoin tempClass = new qualifiedjoin(); 1063 tempClass._joinspecification0 = (joinspecification) _joinspecification0.clone(); 1064 tempClass._tablereference1 = (tablereference) _tablereference1.clone(); 1065 tempClass._SRESERVEDWORD12065439222 = (SRESERVEDWORD1206543922) _SRESERVEDWORD12065439222.clone(); 1066 if (_Optjointype3 != null) { 1067 tempClass._Optjointype3 = (jointype) _Optjointype3.clone(); 1068 } 1069 tempClass._tablereference4 = (tablereference) _tablereference4.clone(); 1070 return tempClass; 1071 } 1072 1073 public boolean isViewOptimizationPossible() throws DException { 1074 throw new UnsupportedOperationException ("Method isViewOptimizationPossible is not supported."); 1075 } 1076 1077 1092 1093 private OrderMappingWithTableRefernces[] getOrderMappingInSimpleJoin(_ServerSession session, _OrderPlan orderPlan, _BVEPlan bvePlan, ConditionArray conditionArray, _QueryColumns queryColumns, boolean isUnderLoj) throws DException { 1094 addJoinCondition(conditionArray); 1095 OrderMappingWithTableRefernces[] leftMapping = _tablereference4.checkForOrderSequencePlan(session, orderPlan, bvePlan, queryColumns, conditionArray, isUnderLoj); 1096 OrderMappingWithTableRefernces[] rightMapping = _tablereference1.checkForOrderSequencePlan(session, orderPlan, bvePlan, queryColumns, conditionArray, isUnderLoj); 1097 return getJoinOrderMappingWithTableRefernces(leftMapping, rightMapping, isUnderLoj); 1098 } 1099 1100 1123 public OrderMappingWithTableRefernces[] checkForOrderSequencePlan(_ServerSession session, _OrderPlan orderPlan, _BVEPlan bvePlan, _QueryColumns queryColumns, ConditionArray conditionArray, boolean isUnderLoj) throws DException { 1124 initializeAppropriateJoinType(conditionArray, session); 1125 if (joinType == INNERJOIN || joinType == JOIN) { 1126 return getOrderMappingInSimpleJoin(session, orderPlan, bvePlan, conditionArray, queryColumns, isUnderLoj); 1127 } 1128 return getMappingInQualified(session, orderPlan, bvePlan, conditionArray, queryColumns, isUnderLoj); 1129 } 1130 1131 1182 1207 private OrderMappingWithTableRefernces[] getMappingInQualified(_ServerSession session, _OrderPlan orderPlan, _BVEPlan bvePlan, ConditionArray conditionArray, _QueryColumns queryColumns, boolean isUnderLoj) throws DException { 1208 int match = TableExpressionConstants.FULLYMATCHED; 1209 isUnderLoj = true; 1210 tablereference tableReferenceLeft = _tablereference4; 1211 tablereference tableReferenceRight = _tablereference1; 1212 if (joinType == RIGHT_OUTER_JOIN) { 1213 tableReferenceLeft = _tablereference1; 1214 tableReferenceRight = _tablereference4; 1215 } 1216 OrderMappingWithTableRefernces[] leftMapping = tableReferenceLeft.checkForOrderSequencePlan(session, orderPlan, bvePlan, queryColumns, conditionArray, isUnderLoj); 1217 addJoinCondition(conditionArray); 1218 OrderMappingWithTableRefernces[] rightMapping = tableReferenceRight.checkForOrderSequencePlan(session, orderPlan, bvePlan, queryColumns, conditionArray, isUnderLoj); 1219 return getOrderMappingInLOJAndROJ(leftMapping, rightMapping, match, orderPlan); 1220 } 1221 1222 1223 1224 1237 private OrderMappingWithTableRefernces[] getOrderMappingInLOJAndROJ(OrderMappingWithTableRefernces[] leftMapping, OrderMappingWithTableRefernces[] rightMapping, int match, _OrderPlan orderPlan) throws DException { 1238 OrderMappingWithTableRefernces belowOrderMapping = getOrderMappingInQualifiedJoin(leftMapping, rightMapping, orderPlan); 1239 return belowOrderMapping == null ? null : new OrderMappingWithTableRefernces[] {belowOrderMapping}; 1240 } 1241 1242 1270 public OrderMappingWithTableRefernces getOrderMappingInQualifiedJoin(OrderMappingWithTableRefernces[] leftMapping, OrderMappingWithTableRefernces[] rightMapping, _OrderPlan orderPlan) throws DException { 1271 if (leftMapping == null) { 1272 if (rightMapping == null) { 1273 return null; 1274 } else { 1275 return new OrderMappingWithTableRefernces(null, TableExpressionConstants.NOTMATCHED, null); 1276 } 1277 } 1278 if (rightMapping == null) { 1279 return new OrderMappingWithTableRefernces(leftMapping[0].getStops(), leftMapping[0].getMatch(), leftMapping[0].getTableDetails()); 1280 } 1281 int leftMatch = leftMapping[0].getMatch(); 1282 int rightMatch = rightMapping[0].getMatch(); 1283 int resultMatch = getResultantMatchInQualifiedJoin(leftMatch, rightMatch); 1284 1285 _SingleTableOrderPlan[] leftStops = leftMapping[0].getStops(); 1286 _SingleTableOrderPlan[] rightStops = rightMapping[0].getStops(); 1287 _SingleTableOrderPlan[] resultStops = getJoinedSingleTableOrderPlans(leftStops, rightStops); 1288 _SingleTableOrderPlan[] orderStops = orderPlan.getSingleTableOrderPlans(); 1289 if (!isSequenceMatched(resultStops, orderStops)) { 1290 return new OrderMappingWithTableRefernces(null, TableExpressionConstants.NOTMATCHED, null); 1291 } 1292 OrderMappingWithTableRefernces result = new OrderMappingWithTableRefernces(resultStops, resultMatch, GeneralPurposeStaticClass.getJointTableDetails(leftMapping[0].getTableDetails(), rightMapping[0].getTableDetails())); 1293 return result; 1294 } 1295 1296 1306 private boolean isSequenceMatched(_SingleTableOrderPlan[] resultStops, _SingleTableOrderPlan[] orderStops) throws DException { 1307 ArrayList found = new ArrayList(5); 1308 for (int i = 0, j = 0; j < orderStops.length && i < resultStops.length; ) { 1309 if (resultStops[i].equals(orderStops[j])) { 1310 found.add(resultStops[i]); 1311 i++; 1312 j++; 1313 } else { 1314 j++; 1315 } 1316 } 1317 if (found.size() == resultStops.length) { 1318 return true; 1319 } else { 1320 return false; 1321 } 1322 } 1323 1330 private _SingleTableOrderPlan[] getJoinedSingleTableOrderPlans(_SingleTableOrderPlan[] leftPlans, _SingleTableOrderPlan[] rightPlans) throws DException { 1331 _SingleTableOrderPlan[] resultStops = new _SingleTableOrderPlan[leftPlans.length + rightPlans.length]; 1332 System.arraycopy(leftPlans, 0, resultStops, 0, leftPlans.length); 1333 System.arraycopy(rightPlans, 0, resultStops, leftPlans.length, rightPlans.length); 1334 return resultStops; 1335 } 1336 1337 1353 private int getResultantMatchInQualifiedJoin(int leftMatch, int rightMatch) throws 1354 DException { 1355 if (leftMatch == TableExpressionConstants.PARTIALLYMATCHED) { 1356 return TableExpressionConstants.NOTMATCHED; 1357 } 1358 if (leftMatch == TableExpressionConstants.NOTMATCHED) { 1359 return TableExpressionConstants.NOTMATCHED; 1360 } 1361 if (rightMatch == TableExpressionConstants.NOTMATCHED) { 1362 return TableExpressionConstants.NOTMATCHED; 1363 } 1364 if (rightMatch == TableExpressionConstants.PARTIALLYMATCHED) { 1365 return TableExpressionConstants.PARTIALLYMATCHED; 1366 } 1367 return TableExpressionConstants.FULLYMATCHED; 1368 } 1369 1370 1393 private OrderMappingWithTableRefernces[] 1394 getJoinOrderMappingWithTableRefernces(OrderMappingWithTableRefernces[] 1395 source1, 1396 OrderMappingWithTableRefernces[] 1397 source2, boolean isUnderLoj) throws 1398 DException { 1399 ArrayList array = new ArrayList(); 1400 if (isUnderLoj) { 1401 if (source1 == null || source2 == null) { 1402 return null; 1403 } 1404 for (int i = 0; i < source1.length; i++) { 1405 _SingleTableOrderPlan[] source1Stops = source1[i].getStops(); 1406 array.addAll(Arrays.asList(source1Stops)); 1407 } 1408 for (int j = 0; j < source2.length; j++) { 1409 _SingleTableOrderPlan[] source2Stops = source2[j].getStops(); 1410 array.addAll(Arrays.asList(source2Stops)); 1411 } 1412 _SingleTableOrderPlan[] resultStops = (_SingleTableOrderPlan[]) array.toArray(new _SingleTableOrderPlan[array.size()]); 1413 int resultMatch = resultantMatchOfInnerJoin(source1, source2); 1414 return new OrderMappingWithTableRefernces[] {new OrderMappingWithTableRefernces(resultStops, resultMatch, getResultantTableDetails(source1, source2))}; 1415 } else { 1416 if (source1 == null) { 1417 return source2; 1418 } 1419 if (source2 == null) { 1420 return source1; 1421 } 1422 OrderMappingWithTableRefernces buffered[] = new 1423 OrderMappingWithTableRefernces[source1.length + source2.length]; 1424 System.arraycopy(source1, 0, buffered, 0, source1.length); 1425 System.arraycopy(source2, 0, buffered, source1.length, source2.length); 1426 return buffered; 1427 } 1428 } 1429 1430 1437 private TableDetails[] getResultantTableDetails(OrderMappingWithTableRefernces[] mapping1, OrderMappingWithTableRefernces[] mapping2) throws DException { 1438 ArrayList list = new ArrayList(); 1439 for (int i = 0; i < mapping1.length; i++) { 1440 list.addAll(Arrays.asList(mapping1[i].getTableDetails())); 1441 } 1442 for (int i = 0; i < mapping2.length; i++) { 1443 list.addAll(Arrays.asList(mapping2[i].getTableDetails())); 1444 } 1445 return (TableDetails[]) list.toArray(new TableDetails[list.size()]); 1446 } 1447 1448 1456 private int resultantMatchOfInnerJoin(OrderMappingWithTableRefernces[] 1457 source1, 1458 OrderMappingWithTableRefernces[] source2) throws 1459 DException { 1460 int resultMatch = TableExpressionConstants.FULLYMATCHED; 1461 int match; 1462 1463 for (int i = 0; i < source1.length; i++) { 1464 match = source1[i].getMatch(); 1465 if (match < resultMatch) { 1466 resultMatch = match; 1467 } 1468 } 1469 for (int j = 0; j < source2.length; j++) { 1470 match = source2[j].getMatch(); 1471 if (match < resultMatch) { 1472 resultMatch = match; 1473 } 1474 } 1475 return resultMatch; 1476 } 1477 1478 1513 1514 private void initializeAppropriateJoinType(ConditionArray conditionArray, _ServerSession serverSession) throws DException { 1515 if (joinType == INNERJOIN || joinType == JOIN) { 1516 return; 1517 } 1518 if (joinType == FULL_OUTER_JOIN) { 1519 initializeAppropriateJoinTypeInFOJ(conditionArray, serverSession); 1520 return; 1521 } 1522 TableDetails[] tableDetails = null; 1523 if (joinType == RIGHT_OUTER_JOIN) { 1524 tableDetails = table1; 1525 } else { tableDetails = table2; 1527 } 1528 if (containsTD(conditionArray.getTableDetails(tableDetails), tableDetails)) { 1529 joinType = INNERJOIN; 1530 return; 1531 } 1532 } 1533 1534 1540 1541 private void initializeAppropriateJoinTypeInFOJ(ConditionArray conditionArray, _ServerSession serverSession) throws DException { 1542 boolean containsTDRight = containsTD(conditionArray.getTableDetails(_tablereference1.getTableDetails(serverSession, null)), _tablereference1.getTableDetails(serverSession, null)); 1543 boolean containsTDLeft = containsTD(conditionArray.getTableDetails(_tablereference4.getTableDetails(serverSession, null)), _tablereference4.getTableDetails(serverSession, null)); 1544 if (containsTDRight && containsTDLeft) { 1545 joinType = INNERJOIN; 1546 return; 1547 } else if (containsTDRight) { 1548 joinType = RIGHT_OUTER_JOIN; 1549 } else if (containsTDLeft) { 1550 joinType = LEFT_OUTER_JOIN; 1551 } 1552 } 1553 1554 1559 private TableDetails[] getAppropriateTableDetails() throws DException { 1560 if (joinType == RIGHT_OUTER_JOIN) { 1561 return GeneralPurposeStaticClass.getJointTableDetails(table2, table1); 1562 } 1563 return tableDetails; 1564 } 1565 1566 1572 1573 public boolean isSimpleQuery(_ServerSession serverSession) throws DException { 1574 return getMyType() == INNERJOIN && isUpdatableResultsetCompliance(serverSession); 1575 } 1576 1577 final private boolean isUpdatableResultsetCompliance(_ServerSession serverSession) throws DException { 1578 ColumnDetails cds[] = _joinspecification0.getColumnDetails(); 1579try{ 1580 int firstConditionType = cds[0].getQuestion() ? CONSTANT : cds[0].getType(); 1581 int secoundConditionType = cds[1].getQuestion() ? CONSTANT : cds[1].getType(); 1582 1583 TableDetails tableDetails[] = this.getTableDetails(serverSession, cds); 1584 1587 if (firstConditionType == CONSTANT && secoundConditionType == CONSTANT) { 1588 return false; 1589 } 1590 1591 if (tableDetails[0].getColumnCharacteristics() instanceof 1592 SelectColumnCharacteristics || 1593 tableDetails[1].getColumnCharacteristics() instanceof SelectColumnCharacteristics) 1594 return false; 1595 1598 else if (firstConditionType == REFERENCE && 1599 secoundConditionType == CONSTANT) { 1600 if (P.indexOfIgnoreCase(tableDetails[0].getColumnCharacteristics(). 1601 getPrimaryKeys(), cds[0].getAppropriateColumn()) != 1602 -1) { 1603 return true; 1604 } 1605 return false; 1606 } 1607 1608 1611 1612 else if (firstConditionType == CONSTANT && 1613 secoundConditionType == REFERENCE) { 1614 1615 if (P.indexOfIgnoreCase(tableDetails[1].getColumnCharacteristics(). 1616 getPrimaryKeys(), cds[1].getAppropriateColumn()) != 1617 -1) { 1618 return true; 1619 } 1620 return false; 1621 } 1622 1625 1626 else if (firstConditionType == REFERENCE && 1627 secoundConditionType == REFERENCE) { 1628 1629 boolean primaryKeyOnFirstColumn = P.indexOfIgnoreCase(tableDetails[0]. 1630 getColumnCharacteristics().getPrimaryKeys(), 1631 cds[0].getAppropriateColumn()) != -1; 1632 boolean primaryKeyOnSecoundColumn = P.indexOfIgnoreCase(tableDetails[1]. 1633 getColumnCharacteristics().getPrimaryKeys(), 1634 cds[1].getAppropriateColumn()) != 1635 -1; 1636 1637 if (primaryKeyOnFirstColumn || primaryKeyOnSecoundColumn) 1638 return true; 1639 return false; 1640 1641 } 1642}catch(Exception ex){ 1643 return false; 1644} 1645 return false; 1646 } 1647 1648 1656 public void verifyValues(_VariableValueOperations variableValueOperation) throws DException { 1657 getMyType(); 1658 if (joinType == LEFT_OUTER_JOIN || joinType == RIGHT_OUTER_JOIN) { 1659 ( (VariableValueOperations) variableValueOperation).setCheckingIgnored(true); 1660 } else { 1661 ( (VariableValueOperations) variableValueOperation).setCheckingIgnored(false); 1662 } 1663 _joinspecification0.verifyValues(variableValueOperation); 1664 } 1665 1666 1678 public void setDefaultValues(_VariableValueOperations variableValueOperation) throws DException { 1679 _tablereference4.setDefaultValues(variableValueOperation); 1680 _tablereference1.setDefaultValues(variableValueOperation); 1681 _joinspecification0.setDefaultValues(variableValueOperation); 1682 } 1683 1684 public _Reference[] checkSemantic(_ServerSession session,_OrderByClause orderClause,boolean checkUserRight,boolean checkSetOperatorPresent) throws DException { 1685 throw new DException("DSE565",new Object []{"checkSemantic()"}); 1686 } 1687 1688 public _TablePlan[] getTablePlans(_ServerSession session, booleanvalueexpression condition, _Order order, ColumnDetails[] columnDetails, ConditionArray conditionArray) throws DException { 1689 throw new UnsupportedOperationException ("Method getTablePlans() not supported"); 1690 } 1691 1692 public boolean hasConstantSelectedColumn(booleanvalueexpression bve) throws DException{ 1693 throw new UnsupportedOperationException ("Method hasConstantSelectedColumn() not supported"); 1694 } 1695 1696 1697 public _Reference[] getReferencesRelatedtoJoin(TableDetails[] td1,_ServerSession parent) throws DException{ 1698 if(refs_Condition==null){ 1699 return null; 1700 } 1701 ArrayList arr=new ArrayList(); 1702 for (int i = 0; i < refs_Condition.length; i++) { 1703 if(refs_Condition[i].getReferenceType()==SimpleConstants.SUBQUERY){ 1704 _Reference[] cd=((subquery)refs_Condition[i]).checkSemantic(parent); 1705 if(cd != null){ 1706 for (int j = 0; j < cd.length; j++) { 1707 if (cd[j].getReferenceType() != SimpleConstants.VARIABLECOLUMN) { 1708 arr.add(cd[j]); 1709 } 1710 } 1711 } 1712 } 1713 } 1714 return arr.isEmpty()? null : (_Reference[])arr.toArray(new _Reference[0]); 1715 } 1716 1717} 1718 | Popular Tags |