1 17 package org.alfresco.jcr.query; 18 19 import javax.jcr.ItemExistsException; 20 import javax.jcr.ItemNotFoundException; 21 import javax.jcr.Node; 22 import javax.jcr.PathNotFoundException; 23 import javax.jcr.RepositoryException; 24 import javax.jcr.UnsupportedRepositoryOperationException; 25 import javax.jcr.lock.LockException; 26 import javax.jcr.nodetype.ConstraintViolationException; 27 import javax.jcr.query.InvalidQueryException; 28 import javax.jcr.query.Query; 29 import javax.jcr.version.VersionException; 30 31 import org.alfresco.jcr.session.SessionImpl; 32 import org.alfresco.jcr.util.JCRProxyFactory; 33 34 35 40 public abstract class QueryImpl implements Query 41 { 42 43 private SessionImpl session; 44 45 46 private String statement; 47 48 49 private Query proxy = null; 50 51 52 57 public QueryImpl(SessionImpl session, String statement) 58 { 59 this.session = session; 60 this.statement = statement; 61 } 62 63 68 public Query getProxy() 69 { 70 if (proxy == null) 71 { 72 proxy = (Query)JCRProxyFactory.create(this, Query.class, session); 73 } 74 return proxy; 75 } 76 77 82 public SessionImpl getSession() 83 { 84 return session; 85 } 86 87 92 public abstract void isValidStatement() throws InvalidQueryException; 93 94 97 public String getStatement() 98 { 99 return statement; 100 } 101 102 105 public String getStoredQueryPath() throws ItemNotFoundException, RepositoryException 106 { 107 throw new ItemNotFoundException("This query has not been saved to the Repository"); 108 } 109 110 113 public Node storeAsNode(String absPath) throws ItemExistsException, PathNotFoundException, VersionException, ConstraintViolationException, LockException, UnsupportedRepositoryOperationException, RepositoryException 114 { 115 throw new UnsupportedRepositoryOperationException(); 116 } 117 118 } 119 | Popular Tags |