1 package org.apache.ojb.soda; 2 3 17 18 import java.io.Serializable ; 19 20 import org.odbms.Constraint; 21 import org.odbms.ObjectSet; 22 import org.odbms.Query; 23 import org.apache.ojb.broker.OJBRuntimeException; 24 import org.apache.ojb.broker.PersistenceBroker; 25 26 30 public class QueryImpl implements Query, Serializable 31 { 32 static final long serialVersionUID = 7117766237756132776L; 33 private org.apache.ojb.broker.query.Query ojbQuery = null; 34 private int limitCount = -1; 35 private PersistenceBroker broker; 36 37 40 public QueryImpl(PersistenceBroker broker) 41 { 42 super(); 43 this.broker = broker; 44 } 45 46 50 public QueryImpl(org.apache.ojb.broker.query.Query query) 51 { 52 super(); 53 ojbQuery = query; 54 } 55 56 57 60 public Constraint constrain(Object example) 61 { 62 return null; 63 } 64 65 68 public ObjectSet execute() 69 { 70 74 if (ojbQuery != null) 75 { 76 return new ObjectSetImpl(broker, ojbQuery, limitCount); 77 } 78 else throw new OJBRuntimeException("internal ojbQuery not filled. Can't execute this query yet!"); 79 } 80 81 84 public Query descendant(String path) 85 { 86 return this; 87 } 88 89 92 public Query parent(String path) 93 { 94 return this; 95 } 96 97 100 public Query limitSize(int count) 101 { 102 limitCount = count; 103 return this; 104 } 105 106 109 public Query orderAscending() 110 { 111 return this; 112 } 113 114 117 public Query orderDescending() 118 { 119 return this; 120 } 121 122 123 128 public void setOjbQuery(org.apache.ojb.broker.query.Query ojbQuery) 129 { 130 this.ojbQuery = ojbQuery; 131 } 132 133 } 134 | Popular Tags |