@SuppressWarnings("rawtypes") @Override public void setCandidates(Extent pcs) { checkUnmodifiable(); this.ext = pcs; if (pcs.getCandidateClass() != candCls) { setClass( pcs.getCandidateClass() ); resetQuery(); } }
@SuppressWarnings("rawtypes") public QueryImpl(PersistenceManagerImpl pm, Extent ext, String filter) { this(pm); this.ext = ext; setClass( this.ext.getCandidateClass() ); this.filter = filter; this.subClasses = ext.hasSubclasses(); }
/** * Construct a query instance with the candidate Extent specified; the * candidate class is taken from the Extent. * @param cln The extent to query * @return The query */ public synchronized Query newQuery(Extent cln) { Query query = newQuery(); query.setClass(cln.getCandidateClass()); query.setCandidates(cln); return query; }
/** * Construct a query instance with the candidate Extent specified; the * candidate class is taken from the Extent. * @param cln The extent to query * @return The query * @param <T> Candidate type for the query */ public <T> Query<T> newQuery(Extent<T> cln) { Query query = newQuery(); query.setClass(cln.getCandidateClass()); query.setCandidates(cln); return query; }
checkUnmodifiable(); ext = new CollectionExtent(pcs, pm, ignoreCache); if (ext.getCandidateClass() != candCls) { setClass(ext.getCandidateClass()); resetQuery();
/** * Construct a query instance with the candidate Extent and filter * specified. The candidate class is taken from the Extent. * @param cln The extent to query * @param filter A filter to apply * @return The query */ public synchronized Query newQuery(Extent cln, String filter) { Query query = newQuery(); query.setClass(cln.getCandidateClass()); query.setCandidates(cln); query.setFilter(filter); return query; }
/** * Construct a query instance with the candidate Extent and filter * specified. The candidate class is taken from the Extent. * @param cln The extent to query * @param filter A filter to apply * @return The query * @param <T> Candidate type for the query */ public <T> Query<T> newQuery(Extent<T> cln, String filter) { Query query = newQuery(); query.setClass(cln.getCandidateClass()); query.setCandidates(cln); query.setFilter(filter); return query; }
/** * Set the candidate Extent to query. * * @param pcs the Candidate Extent. * @see javax.jdo.Query#setCandidates(javax.jdo.Extent) */ public void setCandidates(Extent pcs) { discardCompiled(); assertIsModifiable(); if (pcs == null) { JPOXLogger.JDO_QUERY.warn(LOCALISER.msg("Candidates.ExtentCantBeNull")); return; } if (!(pcs instanceof Queryable)) { throw new JDOUnsupportedOptionException(LOCALISER.msg("JDOQL.ExtentNotQueryableError",pcs.getClass().getName())); } setSubclasses(pcs.hasSubclasses()); setClass(pcs.getCandidateClass()); candidateExtent = pcs; candidateCollection = null; // We have an Extent, so remove any collection }
assertEquals(TestClass.class, ext.getCandidateClass()); assertTrue(ext.hasSubclasses());