congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
EntityBag.persist
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: oberasoftware/jasdb

@Test
public void testInsertOrUpdatePersist() throws JasDBException {
  DBSession session = sessionFactory.createSession();
  EntityBag bag = session.createOrGetBag("insertOrUpdateBag");
  SimpleEntity entity = new SimpleEntity();
  entity.addProperty("Test", "value1");
  String id = bag.persist(entity).getInternalId();
  assertThat(bag.getEntities().size(), is(1L));
  assertThat(bag.getEntity(id).getProperty("Test").getFirstValueObject(), is("value1"));
  SimpleEntity updatedEntity = new SimpleEntity(id);
  updatedEntity.addProperty("AnotherProperty", "AnotherValue");
  bag.persist(updatedEntity);
  assertThat(bag.getEntities().size(), is(1L));
  assertThat(bag.getEntity(id).getProperty("AnotherProperty").getFirstValueObject(), is("AnotherValue"));
}
com.oberasoftware.jasdb.api.sessionEntityBagpersist

Javadoc

Persists the provided entity, if not exists will be created, if already exists it will be updated

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
  • removeEntity
    Removes the entity from the bag using the id
  • 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
  • removeIndex
    Removes the index from the bag
  • removeIndex

Popular in Java

  • Making http post requests using okhttp
  • compareTo (BigDecimal)
  • getExternalFilesDir (Context)
  • getSharedPreferences (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • Notification (javax.management)
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • CodeWhisperer 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