Tabnine Logo
EntityBag.removeEntity
Code IndexAdd Tabnine to your IDE (free)

How to use
removeEntity
method
in
com.oberasoftware.jasdb.api.session.EntityBag

Best Java code snippets using com.oberasoftware.jasdb.api.session.EntityBag.removeEntity (Showing top 3 results out of 315)

origin: oberasoftware/jasdb

@Override
public void remove(Object persistableObject) throws JasDBStorageException {
  MapResult mappedResult = ENTITY_MAPPER.mapTo(persistableObject);
  String bagName = mappedResult.getBagName();
  EntityBag bag = session.createOrGetBag(bagName);
  bag.removeEntity(mappedResult.getJasDBEntity().getInternalId());
}
origin: oberasoftware/jasdb

@Test
public void testDeleteEmptyIndexValue() throws Exception {
  try {
    DBSession session = sessionFactory.createSession();
    EntityBag bag = session.createOrGetBag("somebag");
    bag.ensureIndex(new SimpleIndexField("field", new StringKeyType()), false);
    String id = bag.addEntity(new SimpleEntity().addProperty("anotherfield", "somevalue")).getInternalId();
    bag.removeEntity(id);
  } finally {
    JasDBMain.shutdown();
  }
}
origin: oberasoftware/jasdb

@Test
public void testPersisterRemove() throws Exception {
  int testSize = 1000;
  DBSession session = sessionFactory.createSession();
  EntityBag bag = session.createOrGetBag("testbag");
  bag.ensureIndex(new SimpleIndexField("city", new StringKeyType(100)), false);
  bag.ensureIndex(new SimpleIndexField("testField", new LongKeyType()), true);
  Random rnd = new Random();
  for(int i=0; i<testSize; i++) {
    int cityIdx = rnd.nextInt(SimpleBaseTest.possibleCities.length);
    String city = SimpleBaseTest.possibleCities[cityIdx];
    SimpleEntity entity = new SimpleEntity();
    entity.addProperty("city", city);
    entity.addProperty("testField", (long)i);
    bag.addEntity(entity);
  }
  for(String city : SimpleBaseTest.possibleCities) {
    QueryResult result = bag.find(QueryBuilder.createBuilder().field("city").value(city)).execute();
    for(Entity foundEntity : result) {
      Long testFieldValue = foundEntity.getProperty("testField").getFirstValueObject();
      bag.removeEntity(foundEntity);
      assertFalse("There should no longer be a result", bag.find(QueryBuilder.createBuilder().field("testField").value(testFieldValue)).execute().hasNext());
    }
    result = bag.find(QueryBuilder.createBuilder().field("city").value(city)).execute();
    assertEquals("There should no longer be any entity", (long) 0, result.size());
  }
}

com.oberasoftware.jasdb.api.sessionEntityBagremoveEntity

Javadoc

Remove the entity from the bag

Popular methods of EntityBag

  • addEntity
    Adds an entity to the bag of entities
  • find
    Builds a query for document in the storage for a specific queryfield with optional sorting parameter
  • getEntities
    Execute a query returning all records in the bag with a given max
  • getEntity
    Retrieves a specific entity from the bag
  • updateEntity
    Updates an entity in the bag of entities
  • ensureIndex
    Ensures there is an index present on a given field in this bag, will create if not existent, will do
  • flush
    Forcibly flushes all the data in the bag to the storage
  • getDiskSize
    Returns the size on the disk of the entities
  • getSize
    Returns the amount of entities in the bag
  • persist
    Persists the provided entity, if not exists will be created, if already exists it will be updated
  • removeIndex
    Removes the index from the bag
  • removeIndex

Popular in Java

  • Reactive rest calls using spring rest template
  • onCreateOptionsMenu (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • notifyDataSetChanged (ArrayAdapter)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • Table (org.hibernate.mapping)
    A relational table
  • 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