T
- Type of the Transport ObjectI
- This is the type of the transportable's row key (primary key).
It should be an immutable type and must implement equals()
and hashCode() correctly. *public interface TransportObject<T,I extends Serializable> extends Serializable
TransportObject
is a contract between the business logic and the DAO.
This provides the ability for the transport object to carry data between
application layers and tiers. The transport objects could have well
defined fields as in relational database world or the object could just
have an abstract Hash map or both. The hash map for transport objects is
introduced to leverage the schema-less design of nosql databases.
The implementation of this interface supports a hybrid object that contains
a few well defined fields. If there are columns that need to be
added/deleted in a dynamic fashion, the extension in the form of hash map
should be used.<E extends T> Id<E,I> getId()
Employee
extends from Person
and
Person
implements TransportObject<Person, Long>
.
The following code would be possible.
Id<Person, Long> id = employee.getId(); Id<Employee, Long> id = employee.getId();
Copyright © 2015. All Rights Reserved.