Package org.cyclos.entities
Class SimpleEntity
- java.lang.Object
-
- org.cyclos.entities.SimpleEntity
-
- All Implemented Interfaces:
Cloneable,ProcessableForProxying,IEntity
- Direct Known Subclasses:
Application,ArchivedEntityToRemoveFromIndex,BackgroundTaskExecution,DatabaseHistoryLog,ForkJoin,IdCipherRound,ImportedField,InternetAddressList,IpAddress,IpAddressLog,IpGeolocation,NetworkedEntity,NotifiedAdInterest,OidcKeys,ProfilingSession,UserAgent
@MappedSuperclass public abstract class SimpleEntity extends Object implements Cloneable, IEntity, ProcessableForProxying
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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceSimpleEntity.EntityLoadNotifier
-
Constructor Summary
Constructors Constructor Description SimpleEntity()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()static voidregister(SimpleEntity.EntityLoadNotifier notifier)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-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.cyclos.entities.ProcessableForProxying
getProxyClass
-
-
-
-
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
-
register
public static void register(SimpleEntity.EntityLoadNotifier notifier)
-
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)
-
-