Package io.datarouter.model.entity
Interface Entity<EK extends EntityKey<EK>>
- All Known Implementing Classes:
BaseEntity
public interface Entity<EK extends EntityKey<EK>>
An Entity is a grouping of related databeans that are stored within the same transaction scope.
For example, a User Entity may be comprised of several databean types: a single UserInfo Databean and a collection of
UserRole databeans. In a partitioned RDBMS, the Entity will span two tables per partition, but data for a single User
will reside in the same partition. In schema-less datastores, all databeans for the Entity can be serialized into an
atomic unit like a single Memcached object or a single HBase row. All databeans in the Entity can be fetched together
with a single call to entityNode.get(entityKey). For the RDBMS, this will execute a single txn with two select
operations. For Memcached or HBase the get() will execute in a single operation.
The Entity facilitates passing around a group of related Databeans as a single java object.
-
Method Summary
Modifier and Type Method Description <PK extends EntityPrimaryKey<EK, PK>, D extends Databean<PK, D>>
voidaddDatabeansForQualifierPrefixUnchecked(String subEntityTableName, Collection<? extends Databean<?,?>> databeans)EKgetKey()longgetNumDatabeans()default booleannotEmpty()voidsetKey(EK ek)
-
Method Details
-
setKey
-
getKey
EK getKey() -
addDatabeansForQualifierPrefixUnchecked
<PK extends EntityPrimaryKey<EK, PK>, D extends Databean<PK, D>> void addDatabeansForQualifierPrefixUnchecked(String subEntityTableName, Collection<? extends Databean<?,?>> databeans) -
getNumDatabeans
long getNumDatabeans() -
notEmpty
default boolean notEmpty()
-