Tabnine Logo
Extent
Code IndexAdd Tabnine to your IDE (free)

How to use
Extent
in
javax.jdo

Best Java code snippets using javax.jdo.Extent (Showing top 20 results out of 315)

origin: tzaeschke/zoodb

@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();
}
origin: tzaeschke/zoodb

@Override
public Iterator<E> iterator() {
  return ext.iterator();
}
origin: tzaeschke/zoodb

  public void closeAll() {
    ext.closeAll();
  }
}
origin: tzaeschke/zoodb

assertEquals(pm, ext.getPersistenceManager());
assertEquals(TestClass.class, ext.getCandidateClass());
assertTrue(ext.hasSubclasses());
assertFalse( ext.iterator().hasNext() );
assertFalse(ext.hasSubclasses());
assertFalse( ext.iterator().hasNext() );
assertTrue(ext.hasSubclasses());
pm.setIgnoreCache(false);
ext = pm.getExtent(TestClass.class);
assertTrue( ext.iterator().hasNext() );
ext.closeAll();
assertFalse( ext.iterator().hasNext() );
  ext.iterator().next();
  fail();
} catch (NoSuchElementException e) {
pm.currentTransaction().begin();
ext = pm.getExtent(TestClass.class);
Iterator<?> iter = ext.iterator();
assertTrue( iter.hasNext() );
assertEquals(tc, iter.next());
iter = ext.iterator();
assertTrue( iter.hasNext() );
origin: tzaeschke/zoodb

  @Override
  public void run() {
    Extent<TestSuper> ext = pm.getExtent(TestSuper.class);
    Iterator<TestSuper> iter = ext.iterator();
    while (iter.hasNext() && n < N/2) {
      pm.deletePersistent(iter.next());
      n++;
      if (n % COMMIT_INTERVAL == 0) {
        pm.currentTransaction().commit();
        pm.currentTransaction().begin();
        ext = pm.getExtent(TestSuper.class);
        iter = ext.iterator();
      }
    }
    ext.closeAll();
  }
});
origin: tzaeschke/zoodb

@SuppressWarnings("rawtypes")
@Override
public void setCandidates(Extent pcs) {
  checkUnmodifiable();
  this.ext = pcs;
  if (pcs.getCandidateClass() != candCls) {
    setClass( pcs.getCandidateClass() );
    resetQuery();
  }
}
origin: tzaeschke/zoodb

assertEquals(pm, ext.getPersistenceManager());
assertFalse( ext.iterator().hasNext() );
Iterator<TestClass> iter = ext.iterator();
assertEquals(pm, ext.getPersistenceManager());
assertTrue( iter.hasNext() );
TestClass tc2 = iter.next();
origin: jpox/jpox

/**
 * Accessor for the fetch plan
 * @return The fetch plan
 */
public FetchPlan getFetchPlan()
{
  return extent.getFetchPlan();
}
origin: tzaeschke/zoodb

private void deleteAllBatched(PersistenceManager pm, Class<?> clazz) {
  int batchSize = 10000;
    int commitctr = 0;
    Extent<?> extent = pm.getExtent(clazz,false);
    Iterator<?> it = extent.iterator();
    while(it.hasNext()){
      pm.deletePersistent(it.next());
      if ( batchSize > 0  &&  ++commitctr >= batchSize){
        commitctr = 0;
        pm.currentTransaction().commit();
        pm.currentTransaction().begin();
      }
    }
    extent.closeAll();
 }

origin: jpox/jpox

/**
 * 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;
}
origin: jpox/jpox

((Extent)candidates).getFetchPlan().setGroups(fetchPlan.getGroups());
origin: tzaeschke/zoodb

@Test
public void testBarcelonaDelete(){
  PersistenceManager pm = TestTools.openPM();
  pm.currentTransaction().begin();
  Extent<TC4> extent = pm.getExtent(TC4.class, false);
  Iterator<TC4> it = extent.iterator();
  while(it.hasNext()){
    pm.deletePersistent(it.next());
    //addToCheckSum(5);
  }
  extent.closeAll();
  pm.currentTransaction().commit();
  TestTools.closePM();
}
origin: org.apache.isis.core/isis-core-runtime

@Programmatic
@Override
public void deleteAll(final Class<?>... pcClasses) {
  for (final Class<?> pcClass : pcClasses) {
    final Extent<?> extent = getJdoPersistenceManager().getExtent(pcClass);
    final List<Object> instances = Lists.newArrayList(extent.iterator());
    
    // temporarily disable concurrency checking while this method is performed
    try {
      ConcurrencyChecking.executeWithConcurrencyCheckingDisabled(new Callable<Void>() {
        @Override
        public Void call() {
          getJdoPersistenceManager().deletePersistentAll(instances);
          return null;
        }
      });
    } catch (final Exception ex) {
      throw new FatalException(ex);
    }
  }
}
origin: jpox/jpox

/**
 * 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
}
origin: org.datanucleus/datanucleus-api-jdo

/**
 * 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;
}
origin: tzaeschke/zoodb

  System.out.println("Person found: " + p.getName());
ext.closeAll();
origin: tzaeschke/zoodb

Iterator<TestClassTiny> it = extent.iterator();
int nDel = 0;
while(it.hasNext()){
extent.closeAll();
Iterator<TestClassTiny> it2 = extent.iterator();
assertFalse(it2.hasNext());
origin: tzaeschke/zoodb

  ext2 = ext.iterator();
} else {
origin: tzaeschke/zoodb

checkUnmodifiable();
ext = new CollectionExtent(pcs, pm, ignoreCache);
if (ext.getCandidateClass() != candCls) {
  setClass(ext.getCandidateClass());
  resetQuery();
origin: tzaeschke/zoodb

ext3.closeAll();
javax.jdoExtent

Javadoc

Instances of the Extent class represent the entire collection of instances in the data store of the candidate class or interface possibly including its subclasses or subinterfaces.

The Extent instance has two possible uses:

  1. to iterate all instances of a particular class or interface
  2. to execute a Query in the data store over all instances of a particular class or interface

Most used methods

  • getCandidateClass
    An Extent contains all instances of a particular class or interface in the data store; this method r
  • iterator
    Returns an iterator over all the instances in the Extent. The behavior of the returned iterator migh
  • hasSubclasses
    Returns whether this Extent was defined to contain subclasses.
  • closeAll
    Close all Iterators associated with this Extent instance.Iterators closed by this method will return
  • getFetchPlan
    Get the fetch plan associated with this Extent.
  • getPersistenceManager
    An Extent is managed by a PersistenceManager; this method gives access to the owning PersistenceMana

Popular in Java

  • Start an intent from android
  • addToBackStack (FragmentTransaction)
  • requestLocationUpdates (LocationManager)
  • putExtra (Intent)
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JPanel (javax.swing)
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now