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

How to use
newEntity
method
in
com.ohmdb.impl.TableImpl

Best Java code snippets using com.ohmdb.impl.TableImpl.newEntity (Showing top 20 results out of 315)

origin: com.gitblit.ohmdb/ohmdb-core

private E get_(long id) {
  E entity = newEntity();
  get_(id, entity);
  return entity;
}
origin: com.gitblit.ohmdb/ohmdb

private E get_(long id) {
  E entity = newEntity();
  get_(id, entity);
  return entity;
}
origin: ohmdb/ohmdb

private E get_(long id) {
  E entity = newEntity();
  get_(id, entity);
  return entity;
}
origin: com.gitblit.ohmdb/ohmdb-core

private void doUpdate(long id, DatastoreTransaction tx, E entity) {
  E old = newEntity(), old2 = newEntity(), post = newEntity();
  get_(id, old, old2);
  doTriggers(beforeUpdate, TriggerAction.BEFORE_UPDATE, id, old, entity);
  for (int i = 0; i < tmpIndices.length && tmpIndices[i] != null; i++) {
    tmpIndices[i] = null;
  }
  for (PropertyInfo pr : props) {
    Object val = pr.get(entity);
    setCell(tx, id, pr, val, tmpIndices);
  }
  doTriggers(afterUpdate, TriggerAction.AFTER_UPDATE, id, old, entity);
  get_(id, post);
  // old might be changed by triggers, so use old2 as protection
  doComplexIndices(tmpIndices, old2, post, id);
}
origin: com.gitblit.ohmdb/ohmdb

@Override
public void forEach(long[] ids, Visitor<E> visitor) {
  E entity = newEntity();
  for (long id : ids) {
    get_(id, entity);
    if (visitor.visit(entity)) {
      update(entity);
    }
  }
}
origin: com.gitblit.ohmdb/ohmdb

private void doUpdate(long id, DatastoreTransaction tx, E entity) {
  E old = newEntity(), old2 = newEntity(), post = newEntity();
  get_(id, old, old2);
  doTriggers(beforeUpdate, TriggerAction.BEFORE_UPDATE, id, old, entity);
  for (int i = 0; i < tmpIndices.length && tmpIndices[i] != null; i++) {
    tmpIndices[i] = null;
  }
  for (PropertyInfo pr : props) {
    Object val = pr.get(entity);
    setCell(tx, id, pr, val, tmpIndices);
  }
  doTriggers(afterUpdate, TriggerAction.AFTER_UPDATE, id, old, entity);
  get_(id, post);
  // old might be changed by triggers, so use old2 as protection
  doComplexIndices(tmpIndices, old2, post, id);
}
origin: ohmdb/ohmdb

private void doUpdate(long id, DatastoreTransaction tx, E entity) {
  E old = newEntity(), old2 = newEntity(), post = newEntity();
  get_(id, old, old2);
  doTriggers(beforeUpdate, TriggerAction.BEFORE_UPDATE, id, old, entity);
  for (int i = 0; i < tmpIndices.length && tmpIndices[i] != null; i++) {
    tmpIndices[i] = null;
  }
  for (PropertyInfo pr : props) {
    Object val = pr.get(entity);
    setCell(tx, id, pr, val, tmpIndices);
  }
  doTriggers(afterUpdate, TriggerAction.AFTER_UPDATE, id, old, entity);
  get_(id, post);
  // old might be changed by triggers, so use old2 as protection
  doComplexIndices(tmpIndices, old2, post, id);
}
origin: com.gitblit.ohmdb/ohmdb-core

@Override
public void forEach(long[] ids, Visitor<E> visitor) {
  E entity = newEntity();
  for (long id : ids) {
    get_(id, entity);
    if (visitor.visit(entity)) {
      update(entity);
    }
  }
}
origin: com.gitblit.ohmdb/ohmdb

@Override
public long insert(Map<String, Object> properties) {
  try {
    // WRITE LOCK
    locker.globalWriteLock();
    E entity = newEntity();
    if (properties != null) {
      for (Entry<String, Object> entry : properties.entrySet()) {
        PropertyInfo prop = info.getProperties().get(entry.getKey());
        prop.set(entity, entry.getValue());
      }
    }
    return insertRow(entity);
  } finally {
    // WRITE UNLOCK
    locker.globalWriteUnlock();
  }
}
origin: ohmdb/ohmdb

@Override
public void forEach(long[] ids, Visitor<E> visitor) {
  E entity = newEntity();
  for (long id : ids) {
    get_(id, entity);
    if (visitor.visit(entity)) {
      update(entity);
    }
  }
}
origin: com.gitblit.ohmdb/ohmdb-core

@Override
public long insert(Map<String, Object> properties) {
  try {
    // WRITE LOCK
    locker.globalWriteLock();
    E entity = newEntity();
    if (properties != null) {
      for (Entry<String, Object> entry : properties.entrySet()) {
        PropertyInfo prop = info.getProperties().get(entry.getKey());
        prop.set(entity, entry.getValue());
      }
    }
    return insertRow(entity);
  } finally {
    // WRITE UNLOCK
    locker.globalWriteUnlock();
  }
}
origin: ohmdb/ohmdb

@Override
public long insert(Map<String, Object> properties) {
  try {
    // WRITE LOCK
    locker.globalWriteLock();
    E entity = newEntity();
    if (properties != null) {
      for (Entry<String, Object> entry : properties.entrySet()) {
        PropertyInfo prop = info.getProperties().get(entry.getKey());
        prop.set(entity, entry.getValue());
      }
    }
    return insertRow(entity);
  } finally {
    // WRITE UNLOCK
    locker.globalWriteUnlock();
  }
}
origin: com.gitblit.ohmdb/ohmdb

public TableImpl(OhmDBImpl db, Class<E> clazz, DataStore store, IdColl ids, Transactor transactor,
    OhmDBStats stats, LockManager lockManager) {
  this.db = db;
  this.idColl = ids;
  this.transactor = transactor;
  this.stats = stats;
  this.locker = lockManager;
  this.info = introspector.describe(clazz);
  this.clazz = clazz;
  this.store = store;
  this.size = 0;
  this.rows = 0;
  this.props = info.getProps();
  this.idtor = info.getIdtor();
  this.constr = findConstructor();
  this.queryHelper = newEntity();
  init();
}
origin: com.gitblit.ohmdb/ohmdb-core

public TableImpl(OhmDBImpl db, Class<E> clazz, DataStore store, IdColl ids, Transactor transactor,
    OhmDBStats stats, LockManager lockManager) {
  this.db = db;
  this.idColl = ids;
  this.transactor = transactor;
  this.stats = stats;
  this.locker = lockManager;
  this.info = introspector.describe(clazz);
  this.clazz = clazz;
  this.store = store;
  this.size = 0;
  this.rows = 0;
  this.props = info.getProps();
  this.idtor = info.getIdtor();
  this.constr = findConstructor();
  this.queryHelper = newEntity();
  init();
}
origin: ohmdb/ohmdb

public TableImpl(OhmDBImpl db, Class<E> clazz, DataStore store, IdColl ids, Transactor transactor,
    OhmDBStats stats, LockManager lockManager) {
  this.db = db;
  this.idColl = ids;
  this.transactor = transactor;
  this.stats = stats;
  this.locker = lockManager;
  this.info = introspector.describe(clazz);
  this.clazz = clazz;
  this.store = store;
  this.size = 0;
  this.rows = 0;
  this.props = info.getProps();
  this.idtor = info.getIdtor();
  this.constr = findConstructor();
  this.queryHelper = newEntity();
  init();
}
origin: com.gitblit.ohmdb/ohmdb

@Override
public E get(long id) {
  try {
    // READ LOCK
    locker.globalReadLock();
    checkId(id);
    insider.getting(clazz, id);
    E entity = newEntity();
    doTriggers(beforeRead, TriggerAction.BEFORE_READ, id, null, entity);
    get_(id, entity);
    doTriggers(afterRead, TriggerAction.AFTER_READ, id, null, entity);
    insider.got(clazz, id, entity);
    return entity;
  } finally {
    // READ UNLOCK
    locker.globalReadUnlock();
  }
}
origin: com.gitblit.ohmdb/ohmdb-core

@Override
public E get(long id) {
  try {
    // READ LOCK
    locker.globalReadLock();
    checkId(id);
    insider.getting(clazz, id);
    E entity = newEntity();
    doTriggers(beforeRead, TriggerAction.BEFORE_READ, id, null, entity);
    get_(id, entity);
    doTriggers(afterRead, TriggerAction.AFTER_READ, id, null, entity);
    insider.got(clazz, id, entity);
    return entity;
  } finally {
    // READ UNLOCK
    locker.globalReadUnlock();
  }
}
origin: com.gitblit.ohmdb/ohmdb-core

@SuppressWarnings("unchecked")
private <T> IndexerImpl<E, T> complexIndex(Object[] columns, final Mapper<E, ?> mapper) {
  Index index = makeIndex();
  ComplexIndex<E> complexIndex = new ComplexIndexImpl<E>((Mapper<E, Object>) mapper, index);
  for (Object col : columns) {
    String colName = jokerator.decode(col);
    prop(colName).addComplexIndex(complexIndex);
  }
  allComplexIndices = U.expand(allComplexIndices, complexIndex);
  E entity = newEntity();
  for (long id : ids()) {
    get_(id, entity);
    complexIndex.add(entity, id);
  }
  return new IndexerImpl<E, T>(complexIndex, index);
}
origin: com.gitblit.ohmdb/ohmdb

@SuppressWarnings("unchecked")
private <T> IndexerImpl<E, T> complexIndex(Object[] columns, final Mapper<E, ?> mapper) {
  Index index = makeIndex();
  ComplexIndex<E> complexIndex = new ComplexIndexImpl<E>((Mapper<E, Object>) mapper, index);
  for (Object col : columns) {
    String colName = jokerator.decode(col);
    prop(colName).addComplexIndex(complexIndex);
  }
  allComplexIndices = U.expand(allComplexIndices, complexIndex);
  E entity = newEntity();
  for (long id : ids()) {
    get_(id, entity);
    complexIndex.add(entity, id);
  }
  return new IndexerImpl<E, T>(complexIndex, index);
}
origin: ohmdb/ohmdb

@SuppressWarnings("unchecked")
private <T> IndexerImpl<E, T> complexIndex(Object[] columns, final Mapper<E, ?> mapper) {
  Index index = makeIndex();
  ComplexIndex<E> complexIndex = new ComplexIndexImpl<E>((Mapper<E, Object>) mapper, index);
  for (Object col : columns) {
    String colName = jokerator.decode(col);
    prop(colName).addComplexIndex(complexIndex);
  }
  allComplexIndices = U.expand(allComplexIndices, complexIndex);
  E entity = newEntity();
  for (long id : ids()) {
    get_(id, entity);
    complexIndex.add(entity, id);
  }
  return new IndexerImpl<E, T>(complexIndex, index);
}
com.ohmdb.implTableImplnewEntity

Popular methods of TableImpl

  • <init>
  • checkColumn
  • checkId
  • colInfo
  • commit
  • complexIndex
  • createColumn
  • createIndexOnNamed
  • deleteCell
  • deleteInTx
  • doComplexIndices
  • doTriggers
  • doComplexIndices,
  • doTriggers,
  • doUpdate,
  • findBy,
  • findConstructor,
  • finishTransaction,
  • forEach,
  • get,
  • getTransaction,
  • getUnusedCount

Popular in Java

  • Creating JSON documents from java classes using gson
  • runOnUiThread (Activity)
  • putExtra (Intent)
  • getSupportFragmentManager (FragmentActivity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • HashSet (java.util)
    HashSet is an implementation of a Set. All optional operations (adding and removing) are supported.
  • Collectors (java.util.stream)
  • JComboBox (javax.swing)
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top plugins for WebStorm
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