it.amattioli.dominate
Interface Entity<I extends Serializable>

Show UML class diagram
Type Parameters:
I - The id property class
All Known Subinterfaces:
OptLockEntity<I>
All Known Implementing Classes:
EntityImpl

public interface Entity<I extends Serializable>

This interface should be implemented by all entity objects.

An entity is an object whose identity does not come from its attributes but from an independent identification schema

In our case the identification schema is a particular property called "id" whose class is a generic parameter of this interface.

The id property is the identifier for objects that implements this interface so equals and hashCode methods must be implemented so to use this property to accomplish their job

For details on entity objects see Eric Evans, Domain Driven Design [Addison Wesley] Ch. 4

Author:
a.mattioli

Method Summary
 I getId()
          Returns this entity object identifier.
 void setId(I id)
          Sets this entity object identifier.
 

Method Detail

getId

I getId()
Returns this entity object identifier.

Returns:
this entity object identifier

setId

void setId(I id)
Sets this entity object identifier.

Parameters:
id - the identifier to be set


Copyright © 2011. All Rights Reserved.