Package org.cyclos.entities
Class SimpleEntity
- java.lang.Object
-
- org.cyclos.entities.SimpleEntity
-
- All Implemented Interfaces:
Cloneable,ProcessableForDataTranslation,IEntity
- Direct Known Subclasses:
Application,BackgroundTaskExecution,DatabaseHistoryLog,IdCipherRound,InternetAddressList,NetworkedEntity,NotifiedAdInterest,OidcKeys
@MappedSuperclass public abstract class SimpleEntity extends Object implements Cloneable, IEntity, ProcessableForDataTranslation
Root of the entity class hierarchy. Entities are not serializable, since they are not supposed to be used on other layers than services. For communication between the services and upper layers, DTOs or VOs should be used. TheSimpleEntitycontains just a generated identifier, which is used as base for theequals(Object),hashCode()andtoString()methods
-
-
Constructor Summary
Constructors Constructor Description SimpleEntity()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()booleanequals(Object object)LonggetId()static LonggetId(SimpleEntity entity)Returns the identifier of the given entity, handling nullsstatic List<Long>getIds(Collection<? extends SimpleEntity> entities)Returns a list with entity identifiers, handling nullsstatic Set<Long>getUniqueIds(Collection<? extends SimpleEntity> entities)Returns a set with entity identifiers, handling nullsstatic Set<Long>getUniqueIds(SimpleEntity... entities)Returns a set with entity identifiers, handling nullsinthashCode()booleanisPersistent()booleanisTransient()StringtoShortString()StringtoString()
-
-
-
Method Detail
-
getId
public static Long getId(SimpleEntity entity)
Returns the identifier of the given entity, handling nulls
-
getIds
public static List<Long> getIds(Collection<? extends SimpleEntity> entities)
Returns a list with entity identifiers, handling nulls
-
getUniqueIds
public static Set<Long> getUniqueIds(Collection<? extends SimpleEntity> entities)
Returns a set with entity identifiers, handling nulls
-
getUniqueIds
public static Set<Long> getUniqueIds(SimpleEntity... entities)
Returns a set with entity identifiers, handling nulls
-
isPersistent
public boolean isPersistent()
-
isTransient
public boolean isTransient()
-
toShortString
public String toShortString()
-
-