1 package org.apache.ojb.broker.query; 2 3 17 18 import org.apache.ojb.broker.Identity; 19 20 60 public class QueryByIdentity extends AbstractQueryImpl 61 { 62 private Object m_exampleObjectOrIdentity; 63 64 67 public QueryByIdentity(Object example_or_identity) 68 { 69 m_exampleObjectOrIdentity = example_or_identity; 70 } 71 72 76 public Object getExampleObject() 77 { 78 return m_exampleObjectOrIdentity; 79 } 80 81 87 public Class getSearchClass() 88 { 89 Object obj = getExampleObject(); 90 91 if (obj instanceof Identity) 92 { 93 return ((Identity) obj).getObjectsTopLevelClass(); 94 } 95 else 96 { 97 return obj.getClass(); 98 } 99 } 100 101 } 102 | Popular Tags |