1 21 package oracle.toplink.essentials.mappings; 23 24 import java.security.AccessController ; 25 import java.security.PrivilegedActionException ; 26 import java.util.*; 27 import oracle.toplink.essentials.exceptions.*; 28 import oracle.toplink.essentials.expressions.*; 29 import oracle.toplink.essentials.indirection.*; 30 import oracle.toplink.essentials.internal.descriptors.*; 31 import oracle.toplink.essentials.internal.expressions.*; 32 import oracle.toplink.essentials.internal.indirection.*; 33 import oracle.toplink.essentials.internal.queryframework.JoinedAttributeManager; 34 import oracle.toplink.essentials.internal.security.PrivilegedAccessHelper; 35 import oracle.toplink.essentials.internal.security.PrivilegedClassForName; 36 import oracle.toplink.essentials.internal.sessions.*; 37 import oracle.toplink.essentials.queryframework.*; 38 import oracle.toplink.essentials.internal.sessions.AbstractRecord; 39 import oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl; 40 import oracle.toplink.essentials.internal.sessions.AbstractSession; 41 import oracle.toplink.essentials.descriptors.ClassDescriptor; 42 import oracle.toplink.essentials.internal.helper.Helper; 43 import oracle.toplink.essentials.sessions.DatabaseRecord; 44 45 48 public abstract class ForeignReferenceMapping extends DatabaseMapping { 49 50 51 protected Class referenceClass; 52 protected String referenceClassName; 53 54 55 protected transient AbstractSession tempInitSession; 56 57 58 protected transient ClassDescriptor referenceDescriptor; 59 60 61 protected transient ReadQuery selectionQuery; 62 63 64 protected boolean isPrivateOwned; 65 66 67 protected IndirectionPolicy indirectionPolicy; 68 69 70 protected transient boolean hasCustomSelectionQuery; 71 72 73 protected DatabaseMapping relationshipPartner; 74 75 76 protected String relationshipPartnerAttributeName; 77 78 79 protected boolean cascadePersist; 80 protected boolean cascadeMerge; 81 protected boolean cascadeRefresh; 82 protected boolean cascadeRemove; 83 84 protected ForeignReferenceMapping() { 85 this.isPrivateOwned = false; 86 this.hasCustomSelectionQuery = false; 87 this.useBasicIndirection(); 88 this.cascadePersist = false; 89 this.cascadeMerge = false; 90 this.cascadeRefresh = false; 91 this.cascadeRemove = false; 92 } 93 94 98 public void buildBackupClone(Object clone, Object backup, UnitOfWorkImpl unitOfWork) { 99 Object attributeValue = getAttributeValueFromObject(clone); 100 Object clonedAttributeValue = getIndirectionPolicy().backupCloneAttribute(attributeValue, clone, backup, unitOfWork); 101 setAttributeValueInObject(backup, clonedAttributeValue); 102 } 103 104 109 public abstract Object buildBackupCloneForPartObject(Object attributeValue, Object clone, Object backup, UnitOfWorkImpl unitOfWork); 110 111 115 public void buildClone(Object original, Object clone, UnitOfWorkImpl unitOfWork, JoinedAttributeManager joinedAttributeManager) { 116 Object attributeValue = getAttributeValueFromObject(original); 117 Object clonedAttributeValue = getIndirectionPolicy().cloneAttribute(attributeValue, original, clone, unitOfWork, false); if (joinedAttributeManager != null) { 120 if (joinedAttributeManager.hasJoinedAttributes()) { 121 if (joinedAttributeManager.getJoinedAttributes().contains(getAttributeName())) { 122 if (IndirectContainer.class.isAssignableFrom(clonedAttributeValue.getClass())) { 123 ((IndirectContainer)clonedAttributeValue).getValueHolder().getValue(); 124 } else if (ValueHolderInterface.class.isAssignableFrom(clonedAttributeValue.getClass())) { 125 ((ValueHolderInterface)clonedAttributeValue).getValue(); 126 } 127 } 128 } 129 } 130 setAttributeValueInObject(clone, clonedAttributeValue); 131 } 132 133 150 public void buildCloneFromRow(AbstractRecord databaseRow, JoinedAttributeManager joinManager, Object clone, ObjectBuildingQuery sourceQuery, UnitOfWorkImpl unitOfWork, AbstractSession executionSession) { 151 Object attributeValue = valueFromRow(databaseRow, joinManager, sourceQuery, executionSession); 152 Object clonedAttributeValue = getIndirectionPolicy().cloneAttribute(attributeValue, null, clone, unitOfWork, true); setAttributeValueInObject(clone, clonedAttributeValue); 155 } 156 157 161 public abstract Object buildCloneForPartObject(Object attributeValue, Object original, Object clone, UnitOfWorkImpl unitOfWork, boolean isExisting); 162 163 167 public Object clone() { 168 ForeignReferenceMapping clone = (ForeignReferenceMapping)super.clone(); 169 170 clone.setIndirectionPolicy((IndirectionPolicy)indirectionPolicy.clone()); 171 clone.setSelectionQuery((ReadQuery)getSelectionQuery().clone()); 172 173 return clone; 174 } 175 176 180 public boolean compareObjects(Object firstObject, Object secondObject, AbstractSession session) { 181 if (isPrivateOwned()) { 182 return compareObjectsWithPrivateOwned(firstObject, secondObject, session); 183 } else { 184 return compareObjectsWithoutPrivateOwned(firstObject, secondObject, session); 185 } 186 } 187 188 191 protected abstract boolean compareObjectsWithoutPrivateOwned(Object first, Object second, AbstractSession session); 192 193 196 protected abstract boolean compareObjectsWithPrivateOwned(Object first, Object second, AbstractSession session); 197 198 205 public void convertClassNamesToClasses(ClassLoader classLoader){ 206 super.convertClassNamesToClasses(classLoader); 207 Class referenceClass = null; 208 try{ 209 if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){ 210 try { 211 referenceClass = (Class )AccessController.doPrivileged(new PrivilegedClassForName(getReferenceClassName(), true, classLoader)); 212 } catch (PrivilegedActionException exception) { 213 throw ValidationException.classNotFoundWhileConvertingClassNames(getReferenceClassName(), exception.getException()); 214 } 215 } else { 216 referenceClass = oracle.toplink.essentials.internal.security.PrivilegedAccessHelper.getClassForName(getReferenceClassName(), true, classLoader); 217 } 218 } catch (ClassNotFoundException exc){ 219 throw ValidationException.classNotFoundWhileConvertingClassNames(getReferenceClassName(), exc); 220 } 221 setReferenceClass(referenceClass); 222 }; 223 224 232 public UnitOfWorkValueHolder createUnitOfWorkValueHolder(ValueHolderInterface attributeValue, Object original, Object clone, AbstractRecord row, UnitOfWorkImpl unitOfWork, boolean buildDirectlyFromRow) { 233 return new UnitOfWorkQueryValueHolder(attributeValue, clone, this, row, unitOfWork); 234 } 235 236 241 protected boolean dontDoMerge(Object target, Object source, MergeManager mergeManager) { 242 if (!shouldMergeCascadeReference(mergeManager)) { 243 return true; 244 } 245 if (mergeManager.shouldMergeOriginalIntoWorkingCopy()) { 246 if (!isAttributeValueInstantiated(target)) { 248 return true; 249 } 250 } else { 251 if (mergeManager.shouldRefreshRemoteObject() && shouldMergeCascadeParts(mergeManager) && usesIndirection()) { 252 return true; 253 } else { 254 if (!isAttributeValueInstantiated(source)) { 255 return true; 256 } 257 } 258 } 259 return false; 260 } 261 262 268 public void dontUseIndirection() { 269 setIndirectionPolicy(new NoIndirectionPolicy()); 270 } 271 272 277 public ObjectLevelReadQuery prepareNestedJoins(JoinedAttributeManager joinManager, AbstractSession session) { 278 ObjectLevelReadQuery nestedQuery = (ObjectLevelReadQuery)((ObjectLevelReadQuery)getSelectionQuery()).deepClone(); 280 nestedQuery.setSession(session); 282 nestedQuery.getJoinedAttributeManager().setJoinedMappingIndexes_(null); 284 nestedQuery.getJoinedAttributeManager().setJoinedMappingExpressions_(new ArrayList(1)); 285 nestedQuery.getJoinedAttributeManager().setJoinedAttributeExpressions_(extractNestedExpressions(joinManager.getJoinedAttributeExpressions(), nestedQuery.getExpressionBuilder(), false)); 286 nestedQuery.getJoinedAttributeManager().prepareJoinExpressions(session); 288 nestedQuery.getJoinedAttributeManager().computeJoiningMappingIndexes(true, session, 0); 289 if (joinManager.getBaseQuery().isLockQuery()) { 290 ObjectLevelReadQuery baseQuery = ((ObjectLevelReadQuery)joinManager.getBaseQuery()); 291 if (baseQuery.getLockingClause().isForUpdateOfClause()) { 292 ForUpdateOfClause clause = (ForUpdateOfClause)baseQuery.getLockingClause().clone(); 293 clause.setLockedExpressions(extractNestedExpressions(clause.getLockedExpressions(), nestedQuery.getExpressionBuilder(), true)); 294 nestedQuery.setLockingClause(clause); 295 } else { 296 nestedQuery.setLockingClause(baseQuery.getLockingClause()); 297 } 298 } 299 nestedQuery.setShouldMaintainCache(joinManager.getBaseQuery().shouldMaintainCache()); 300 nestedQuery.setShouldRefreshIdentityMapResult(joinManager.getBaseQuery().shouldRefreshIdentityMapResult()); 301 nestedQuery.setCascadePolicy(joinManager.getBaseQuery().getCascadePolicy()); 302 nestedQuery.setSession(null); 303 304 return nestedQuery; 305 306 } 307 308 312 public Object getAttributeValueFromObject(Object object) throws DescriptorException { 313 Object attributeValue = super.getAttributeValueFromObject(object); 314 Object indirectionValue = getIndirectionPolicy().validateAttributeOfInstantiatedObject(attributeValue); 315 316 if (indirectionValue != attributeValue) { 319 setAttributeValueInObject(object, indirectionValue); 320 attributeValue = indirectionValue; 321 } 322 return attributeValue; 323 } 324 325 329 public IndirectionPolicy getIndirectionPolicy() { 330 return indirectionPolicy; 331 } 332 333 338 public Expression getJoinCriteria(QueryKeyExpression exp) { 339 Expression selectionCriteria = getSelectionCriteria(); 340 return exp.getBaseExpression().twist(selectionCriteria, exp); 341 } 342 343 349 public Object getRealAttributeValueFromObject(Object object, AbstractSession session) { 350 return getIndirectionPolicy().getRealAttributeValueFromObject(getAttributeValueFromObject(object)); 351 } 352 353 357 public Class getReferenceClass() { 358 return referenceClass; 359 } 360 361 365 public String getReferenceClassName() { 366 if ((referenceClassName == null) && (referenceClass != null)) { 367 referenceClassName = referenceClass.getName(); 368 } 369 return referenceClassName; 370 } 371 372 377 public ClassDescriptor getReferenceDescriptor() { 378 if (referenceDescriptor == null) { 379 if (getTempSession() == null) { 380 return null; 381 } else { 382 referenceDescriptor = getTempSession().getDescriptor(getReferenceClass()); 383 } 384 } 385 386 return referenceDescriptor; 387 } 388 389 394 public DatabaseMapping getRelationshipPartner() { 395 if ((this.relationshipPartner == null) && (this.relationshipPartnerAttributeName != null)) { 396 setRelationshipPartner(getReferenceDescriptor().getMappingForAttributeName(getRelationshipPartnerAttributeName())); 397 } 398 return this.relationshipPartner; 399 } 400 401 405 public String getRelationshipPartnerAttributeName() { 406 return this.relationshipPartnerAttributeName; 407 } 408 409 414 public Expression getSelectionCriteria() { 415 return getSelectionQuery().getSelectionCriteria(); 416 } 417 418 422 public ReadQuery getSelectionQuery() { 423 return selectionQuery; 424 } 425 426 protected AbstractSession getTempSession() { 427 return tempInitSession; 428 } 429 430 435 public boolean hasCustomSelectionQuery() { 436 return hasCustomSelectionQuery; 437 } 438 439 443 public void initialize(AbstractSession session) throws DescriptorException { 444 super.initialize(session); 445 initializeReferenceDescriptor(session); 446 initializeSelectionQuery(session); 447 getIndirectionPolicy().initialize(); 448 } 449 450 453 protected void initializeReferenceDescriptor(AbstractSession session) throws DescriptorException { 454 if (getReferenceClass() == null) { 455 throw DescriptorException.referenceClassNotSpecified(this); 456 } 457 458 ClassDescriptor refDescriptor = session.getDescriptor(getReferenceClass()); 459 460 if (refDescriptor == null) { 461 throw DescriptorException.descriptorIsMissing(getReferenceClass().getName(), this); 462 } 463 464 if (refDescriptor.isAggregateDescriptor() && (!isAggregateCollectionMapping())) { 465 throw DescriptorException.referenceDescriptorCannotBeAggregate(this); 466 } 467 468 if ((!((this.getDescriptor() != null) && this.getDescriptor().isIsolated())) && refDescriptor.isIsolated()) { 471 throw DescriptorException.isolateDescriptorReferencedBySharedDescriptor(refDescriptor.getJavaClassName(), this.getDescriptor().getJavaClassName(), this); 472 } 473 474 setReferenceDescriptor(refDescriptor); 475 } 476 477 480 protected void initializeSelectionQuery(AbstractSession session) throws DescriptorException { 481 if (((ObjectLevelReadQuery)getSelectionQuery()).getReferenceClass() == null) { 482 throw DescriptorException.referenceClassNotSpecified(this); 483 } 484 485 getSelectionQuery().setDescriptor(getReferenceDescriptor()); 486 } 487 488 492 public boolean isAttributeValueInstantiated(Object object) { 493 return getIndirectionPolicy().objectIsInstantiated(getAttributeValueFromObject(object)); 494 } 495 496 500 public boolean isCascadePersist() { 501 return this.cascadePersist; 502 } 503 504 508 public boolean isCascadeMerge() { 509 return this.cascadeMerge; 510 } 511 512 516 public boolean isCascadeRefresh() { 517 return this.cascadeRefresh; 518 } 519 520 524 public boolean isCascadeRemove() { 525 return this.cascadeRemove; 526 } 527 528 531 public boolean isForeignReferenceMapping() { 532 return true; 533 } 534 535 539 public boolean isPrivateOwned() { 540 return isPrivateOwned; 541 } 542 543 549 public void iterate(DescriptorIterator iterator) { 550 Object attributeValue = this.getAttributeValueFromObject(iterator.getVisitedParent()); 551 this.getIndirectionPolicy().iterateOnAttributeValue(iterator, attributeValue); 552 } 553 554 559 public abstract void iterateOnRealAttributeValue(DescriptorIterator iterator, Object realAttributeValue); 560 561 566 public void privateOwnedRelationship() { 567 setIsPrivateOwned(true); 568 } 569 570 574 public void setCascadeAll(boolean value) { 575 setCascadePersist(value); 576 setCascadeMerge(value); 577 setCascadeRefresh(value); 578 setCascadeRemove(value); 579 } 580 581 585 public void setCascadePersist(boolean value) { 586 this.cascadePersist = value; 587 } 588 589 593 public void setCascadeMerge(boolean value) { 594 this.cascadeMerge = value; 595 } 596 597 601 public void setCascadeRefresh(boolean value) { 602 this.cascadeRefresh = value; 603 } 604 605 609 public void setCascadeRemove(boolean value) { 610 this.cascadeRemove = value; 611 } 612 613 619 public void setCustomSelectionQuery(ReadQuery query) { 620 setSelectionQuery(query); 621 setHasCustomSelectionQuery(true); 622 } 623 624 protected void setHasCustomSelectionQuery(boolean bool) { 625 hasCustomSelectionQuery = bool; 626 } 627 628 632 public void setIndirectionPolicy(IndirectionPolicy indirectionPolicy) { 633 this.indirectionPolicy = indirectionPolicy; 634 indirectionPolicy.setMapping(this); 635 } 636 637 641 public void setIsPrivateOwned(boolean isPrivateOwned) { 642 this.isPrivateOwned = isPrivateOwned; 643 } 644 645 651 public void setRealAttributeValueInObject(Object object, Object value) throws DescriptorException { 652 this.getIndirectionPolicy().setRealAttributeValueInObject(object, value); 653 } 654 655 659 public void setReferenceClass(Class referenceClass) { 660 this.referenceClass = referenceClass; 661 if (referenceClass != null) { 662 setReferenceClassName(referenceClass.getName()); 663 setSelectionQuery(getSelectionQuery()); 665 } 666 } 667 668 672 public void setReferenceClassName(String referenceClassName) { 673 this.referenceClassName = referenceClassName; 674 } 675 676 680 protected void setReferenceDescriptor(ClassDescriptor aDescriptor) { 681 referenceDescriptor = aDescriptor; 682 } 683 684 689 public void setRelationshipPartner(DatabaseMapping mapping) { 690 this.relationshipPartner = mapping; 691 } 692 693 699 public void setRelationshipPartnerAttributeName(String attributeName) { 700 this.relationshipPartnerAttributeName = attributeName; 701 } 702 703 709 public void setSelectionCriteria(Expression anExpression) { 710 getSelectionQuery().setSelectionCriteria(anExpression); 711 } 712 713 716 protected void setSelectionQuery(ReadQuery aQuery) { 717 selectionQuery = aQuery; 718 if ((selectionQuery != null) && selectionQuery.isObjectLevelReadQuery() && (selectionQuery.getReferenceClassName() == null)) { 720 ((ObjectLevelReadQuery)selectionQuery).setReferenceClass(getReferenceClass()); 721 } 722 } 723 724 729 public void setSelectionSQLString(String sqlString) { 730 getSelectionQuery().setSQLString(sqlString); 731 setCustomSelectionQuery(getSelectionQuery()); 732 } 733 734 739 public void setSelectionCall(Call call) { 740 getSelectionQuery().setCall(call); 741 setCustomSelectionQuery(getSelectionQuery()); 742 } 743 744 protected void setTempSession(AbstractSession session) { 745 this.tempInitSession = session; 746 } 747 748 756 public void setUsesIndirection(boolean usesIndirection) { 757 if (usesIndirection) { 758 useBasicIndirection(); 759 } else { 760 dontUseIndirection(); 761 } 762 } 763 764 protected boolean shouldInitializeSelectionCriteria() { 765 if (hasCustomSelectionQuery()) { 766 return false; 767 } 768 769 if (getSelectionCriteria() == null) { 770 return true; 771 } 772 773 return false; 774 } 775 776 780 public boolean shouldMergeCascadeParts(MergeManager mergeManager) { 781 return ((mergeManager.shouldCascadeByMapping() && this.isCascadeMerge()) || (mergeManager.shouldCascadeAllParts()) || (mergeManager.shouldCascadePrivateParts() && isPrivateOwned())); 782 } 783 784 787 protected boolean shouldMergeCascadeReference(MergeManager mergeManager) { 788 if (mergeManager.shouldCascadeReferences()) { 789 return true; 790 } 791 792 return shouldMergeCascadeParts(mergeManager); 795 } 796 797 801 protected boolean shouldObjectModifyCascadeToParts(ObjectLevelModifyQuery query) { 802 if (isReadOnly()) { 803 return false; 804 } 805 806 if (query.shouldCascadeOnlyDependentParts()) { 808 return hasConstraintDependency(); 809 } 810 811 if (isPrivateOwned()) { 812 return true; 813 } 814 815 return query.shouldCascadeAllParts(); 816 } 817 818 824 public void useBasicIndirection() { 825 setIndirectionPolicy(new BasicIndirectionPolicy()); 826 } 827 828 834 public boolean usesIndirection() { 835 return getIndirectionPolicy().usesIndirection(); 836 } 837 838 842 public void validateBeforeInitialization(AbstractSession session) throws DescriptorException { 843 super.validateBeforeInitialization(session); 844 845 if (getAttributeAccessor() instanceof InstanceVariableAttributeAccessor) { 846 Class attributeType = ((InstanceVariableAttributeAccessor)getAttributeAccessor()).getAttributeType(); 847 getIndirectionPolicy().validateDeclaredAttributeType(attributeType, session.getIntegrityChecker()); 848 } else if (getAttributeAccessor() instanceof MethodAttributeAccessor) { 849 Class returnType = ((MethodAttributeAccessor)getAttributeAccessor()).getGetMethodReturnType(); 850 getIndirectionPolicy().validateGetMethodReturnType(returnType, session.getIntegrityChecker()); 851 852 Class parameterType = ((MethodAttributeAccessor)getAttributeAccessor()).getSetMethodParameterType(); 853 getIndirectionPolicy().validateSetMethodParameterType(parameterType, session.getIntegrityChecker()); 854 } 855 } 856 857 862 public Object valueFromRow(AbstractRecord row, JoinedAttributeManager joinManager, ObjectBuildingQuery query, AbstractSession executionSession) throws DatabaseException { 863 if(shouldUseValueFromRowWithJoin(joinManager)) { 864 return valueFromRowInternalWithJoin(row, joinManager, executionSession); 865 } else { 866 return valueFromRowInternal(row, joinManager, executionSession); 867 } 868 } 869 870 875 protected boolean shouldUseValueFromRowWithJoin(JoinedAttributeManager joinManager) { 876 return isJoiningSupported() && ( 877 joinManager.isAttributeJoined(getDescriptor(), getAttributeName()) || 878 joinManager.getBaseQuery().hasPartialAttributeExpressions()); } 880 881 889 protected Object valueFromRowInternalWithJoin(AbstractRecord row, JoinedAttributeManager joinManager, AbstractSession executionSession) throws DatabaseException { 890 throw ValidationException.mappingDoesNotOverrideValueFromRowInternalWithJoin(Helper.getShortClassName(this.getClass())); 891 } 892 893 898 protected Object valueFromRowInternal(AbstractRecord row, JoinedAttributeManager joinManager, AbstractSession executionSession) throws DatabaseException { 899 ReadQuery targetQuery = this.selectionQuery; 901 902 if (!this.indirectionPolicy.usesIndirection()) { 905 targetQuery = (ReadQuery)targetQuery.clone(); 906 targetQuery.setQueryId(joinManager.getBaseQuery().getQueryId()); 907 } 908 909 if (targetQuery.isObjectLevelReadQuery() && (joinManager.getBaseQuery().shouldCascadeAllParts() || (this.isPrivateOwned && joinManager.getBaseQuery().shouldCascadePrivateParts()) || (this.cascadeRefresh && joinManager.getBaseQuery().shouldCascadeByMapping()))) { 911 if (targetQuery == this.selectionQuery) { 914 targetQuery = (ObjectLevelReadQuery)targetQuery.clone(); 915 } 916 917 ((ObjectLevelReadQuery)targetQuery).setShouldRefreshIdentityMapResult(joinManager.getBaseQuery().shouldRefreshIdentityMapResult()); 918 targetQuery.setCascadePolicy(joinManager.getBaseQuery().getCascadePolicy()); 919 920 if (targetQuery.shouldMaintainCache()) { 922 targetQuery.setShouldMaintainCache(joinManager.getBaseQuery().shouldMaintainCache()); 923 } 924 } 925 if (joinManager.getBaseQuery().isObjectLevelReadQuery()){ 926 targetQuery = prepareHistoricalQuery(targetQuery, (ObjectLevelReadQuery)joinManager.getBaseQuery(), executionSession); 927 } 928 929 return this.indirectionPolicy.valueFromQuery(targetQuery, row, executionSession); 930 } 931 932 937 protected ReadQuery prepareHistoricalQuery(ReadQuery targetQuery, ObjectLevelReadQuery sourceQuery, AbstractSession executionSession) { 938 return targetQuery; 939 } 940 941 944 public AbstractRecord trimRowForJoin(AbstractRecord row, JoinedAttributeManager joinManager, AbstractSession executionSession) { 945 if (joinManager.getJoinedMappingIndexes_() != null) { 949 Object value = joinManager.getJoinedMappingIndexes_().get(this); 950 if(value != null) { 951 return trimRowForJoin(row, value, executionSession); 952 } 953 } 954 return row; 955 } 956 957 960 public AbstractRecord trimRowForJoin(AbstractRecord row, Object value, AbstractSession executionSession) { 961 int fieldStartIndex; 965 if(value instanceof Integer ) { 966 fieldStartIndex = ((Integer )value).intValue(); 967 } else { 968 Map map = (Map)value; 970 Class cls; 971 if (getDescriptor().hasInheritance() && getDescriptor().getInheritancePolicy().shouldReadSubclasses()) { 972 cls = getDescriptor().getInheritancePolicy().classFromRow(row, executionSession); 973 } else { 974 cls = getDescriptor().getJavaClass(); 975 } 976 fieldStartIndex = ((Integer )map.get(cls)).intValue(); 977 } 978 Vector trimedFields = Helper.copyVector(row.getFields(), fieldStartIndex, row.size()); 979 Vector trimedValues = Helper.copyVector(row.getValues(), fieldStartIndex, row.size()); 980 return new DatabaseRecord(trimedFields, trimedValues); 981 } 982 } 983 | Popular Tags |