1 2 12 package com.versant.core.jdo; 13 14 import com.versant.core.common.OID; 15 16 import java.util.Collection ; 17 import java.util.Iterator ; 18 import java.util.List ; 19 import java.util.ListIterator ; 20 21 import com.versant.core.common.BindingSupportImpl; 22 23 import javax.jdo.PersistenceManager; 24 25 36 public abstract class QueryResultBase implements QueryResult { 37 38 private QueryResult next; 39 private QueryResult prev; 40 41 public final QueryResult getNext() { 42 return next; 43 } 44 45 public final void setNext(QueryResult next) { 46 this.next = next; 47 } 48 49 public final QueryResult getPrev() { 50 return prev; 51 } 52 53 public final void setPrev(QueryResult prev) { 54 this.prev = prev; 55 } 56 57 public abstract void close(); 58 59 public abstract void setParams(Object [] params); 60 61 public abstract Iterator createInternalIterNoFlush(); 62 63 public boolean add(Object o) { 64 throw BindingSupportImpl.getInstance().unsupportedOperation("Modification not allowed"); 65 } 66 67 public boolean remove(Object o) { 68 throw BindingSupportImpl.getInstance().unsupportedOperation("Modification not allowed"); 69 } 70 71 public boolean addAll(Collection c) { 72 throw BindingSupportImpl.getInstance().unsupportedOperation("Modification not allowed"); 73 } 74 75 public boolean addAll(int index, Collection c) { 76 throw BindingSupportImpl.getInstance().unsupportedOperation("Modification not allowed"); 77 } 78 79 public boolean removeAll(Collection c) { 80 throw BindingSupportImpl.getInstance().unsupportedOperation("Modification not allowed"); 81 } 82 83 public boolean retainAll(Collection c) { 84 throw BindingSupportImpl.getInstance().unsupportedOperation("Modification not allowed"); 85 } 86 87 public void clear() { 88 throw BindingSupportImpl.getInstance().unsupportedOperation("Modification not allowed"); 89 } 90 91 public Object set(int index, Object element) { 92 throw BindingSupportImpl.getInstance().unsupportedOperation("Modification not allowed"); 93 } 94 95 public void add(int index, Object element) { 96 throw BindingSupportImpl.getInstance().unsupportedOperation("Modification not allowed"); 97 } 98 99 public Object remove(int index) { 100 throw BindingSupportImpl.getInstance().unsupportedOperation("Modification not allowed"); 101 } 102 103 public abstract int size(); 104 105 public abstract boolean isEmpty(); 106 107 public abstract boolean contains(Object o); 108 109 public abstract Iterator iterator(); 110 111 public abstract Object [] toArray(); 112 113 public abstract Object [] toArray(Object a[]); 114 115 public abstract boolean containsAll(Collection c); 116 117 public abstract Object get(int index); 118 119 public abstract int indexOf(Object o); 120 121 public abstract int lastIndexOf(Object o); 122 123 public abstract ListIterator listIterator(); 124 125 public abstract ListIterator listIterator(int index); 126 127 public abstract List subList(int fromIndex, int toIndex); 128 129 public static Object resolveRow(Object row, PersistenceManager pm) { 130 if (row == null) return null; 131 if (row instanceof OID) { 132 return pm.getObjectById(row, false); 133 } else if (row instanceof Object []) { 134 Object [] data = (Object [])row; 135 for (int i = 0; i < data.length; i++) { 136 Object o = data[i]; 137 if (o instanceof OID) { 138 data[i] = pm.getObjectById(o, false); 139 } 140 } 141 } 142 return row; 143 } 144 } 145 | Popular Tags |