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

How to use
iterator
method
in
javax.jdo.Extent

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

origin: tzaeschke/zoodb

@Override
public Iterator<E> iterator() {
  return ext.iterator();
}
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: 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

  ext2 = ext.iterator();
} else {
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: 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: tzaeschke/zoodb

  /**
   * Test import of ZooDB 0.3 xml files.
   */
  @Test
  public void testImport0_3() {
    String path = Test_014_XmlImportExport.class.getResource("XmlComplexTest.xml").getPath();
    
      //import to DB
    TestTools.defineSchema(TestSerializer.class, TestSuper.class, DBLargeVector.class);
    ZooXmlImport.main(new String[]{TestTools.getDbName(), path});
    
    //check target
    PersistenceManager pm2 = TestTools.openPM();
    pm2.currentTransaction().begin();
        
    //Check for content in target
    Extent<TestSerializer> ext = pm2.getExtent(TestSerializer.class); 
    TestSerializer ts2 = ext.iterator().next();
    ts2.check(false);
    pm2.currentTransaction().rollback();
    TestTools.closePM();
  }
}
origin: org.datanucleus/datanucleus-api-jdo

Iterator iter = ex.iterator();
while (iter.hasNext())
origin: tzaeschke/zoodb

@Test
public void testExtentWithAuto() {
  PersistenceManager pm = TestTools.openPM(props);
  pm.currentTransaction().begin();
  try {
    //
    pm.getExtent(RuntimeException.class);
    fail();
  } catch (JDOUserException e) {
    //good
  }
  Extent<?> e = pm.getExtent(TestClassTiny2.class);
  assertFalse(e.iterator().hasNext());
  Extent<?> e2 = pm.getExtent(TestClassTiny.class, true);
  assertFalse(e2.iterator().hasNext());
  assertNull(ZooJdoHelper.schema(pm).getClass(TestClassTiny.class));
  assertNull(ZooJdoHelper.schema(pm).getClass(TestClassTiny2.class));
  
  pm.currentTransaction().rollback();
  TestTools.closePM();
}
origin: org.datanucleus/datanucleus-api-jdo

Iterator iter = ex.iterator();
while (iter.hasNext())
origin: tzaeschke/zoodb

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

Iterator<TestClass> it = pm.getExtent(TestClass.class).iterator();
int n = 0;
while (n < N/2 && it.hasNext()) {
origin: tzaeschke/zoodb

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

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

Iterator<TestClass> it = pm.getExtent(TestClass.class).iterator();
int n = 0;
while (n < N/2 && it.hasNext()) {
origin: tzaeschke/zoodb

  ex.iterator().next();
  fail();
} catch (JDOUserException e) {
origin: tzaeschke/zoodb

assertFalse(ext.iterator().hasNext());
ext.closeAll();
origin: tzaeschke/zoodb

assertFalse(ex.iterator().hasNext());
origin: tzaeschke/zoodb

Iterator<TestClassTiny> ei = ex1.iterator();
int n = 0;
while (ei.hasNext()) {
origin: tzaeschke/zoodb

assertFalse(ext.iterator().hasNext());
ext.closeAll();
javax.jdoExtentiterator

Javadoc

Returns an iterator over all the instances in the Extent. The behavior of the returned iterator might depend on the setting of the ignoreCache flag in the owning PersistenceManager.

Popular methods of Extent

  • getCandidateClass
    An Extent contains all instances of a particular class or interface in the data store; this method r
  • 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

  • Creating JSON documents from java classes using gson
  • startActivity (Activity)
  • putExtra (Intent)
  • findViewById (Activity)
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • Top PhpStorm plugins
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