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()inthashCode()static Longid(SimpleEntity entity)Returns the identifier of the given entity, handling nullsstatic List<Long>ids(Collection<? extends SimpleEntity> entities)Returns a list with entity identifiers, handling nullsbooleanisPersistent()booleanisTransient()protected voidsetId(Long id)StringtoShortString()StringtoString()static Set<Long>uniqueIds(Collection<? extends SimpleEntity> entities)Returns a set with entity identifiers, handling nullsstatic Set<Long>uniqueIds(SimpleEntity... entities)Returns a set with entity identifiers, handling nulls
-
-
-
Method Detail
-
id
public static Long id(SimpleEntity entity)
Returns the identifier of the given entity, handling nulls
-
ids
public static List<Long> ids(Collection<? extends SimpleEntity> entities)
Returns a list with entity identifiers, handling nulls
-
uniqueIds
public static Set<Long> uniqueIds(Collection<? extends SimpleEntity> entities)
Returns a set with entity identifiers, handling nulls
-
uniqueIds
public static Set<Long> uniqueIds(SimpleEntity... entities)
Returns a set with entity identifiers, handling nulls
-
isPersistent
public boolean isPersistent()
-
isTransient
public boolean isTransient()
-
toShortString
public String toShortString()
-
setId
protected void setId(Long id)
-
-