|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.engine.spi.EntityKey
public final class EntityKey
Uniquely identifies of an entity instance in a particular Session by identifier. Note that it's only safe to be used within the scope of a Session: it doesn't consider for example the tenantId as part of the equality definition.
Information used to determine uniqueness consists of the entity-name and the identifier value (seeequals(java.lang.Object)
).
Performance considerations: lots of instances of this type are created at runtime. Make sure each one is as small as possible
by storing just the essential needed.
Constructor Summary | |
---|---|
EntityKey(Serializable id,
EntityPersister persister)
Construct a unique identifier for an entity class instance. |
Method Summary | |
---|---|
static EntityKey |
deserialize(ObjectInputStream ois,
SessionFactoryImplementor sessionFactory)
Custom deserialization routine used during deserialization of a Session/PersistenceContext for increased performance. |
boolean |
equals(Object other)
|
String |
getEntityName()
|
Serializable |
getIdentifier()
|
int |
hashCode()
|
boolean |
isBatchLoadable()
|
void |
serialize(ObjectOutputStream oos)
Custom serialization routine used during serialization of a Session/PersistenceContext for increased performance. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public EntityKey(Serializable id, EntityPersister persister)
NOTE : This signature has changed to accommodate both entity mode and multi-tenancy, both of which relate to
the Session to which this key belongs. To help minimize the impact of these changes in the future, the
SessionImplementor.generateEntityKey(java.io.Serializable, org.hibernate.persister.entity.EntityPersister)
method was added to hide the session-specific changes.
id
- The entity idpersister
- The entity persisterMethod Detail |
---|
public boolean isBatchLoadable()
public Serializable getIdentifier()
public String getEntityName()
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public void serialize(ObjectOutputStream oos) throws IOException
oos
- The stream to which we should write the serial data.
IOException
- Thrown by Java I/Opublic static EntityKey deserialize(ObjectInputStream ois, SessionFactoryImplementor sessionFactory) throws IOException, ClassNotFoundException
ois
- The stream from which to read the entry.sessionFactory
- The SessionFactory owning the Session being deserialized.
IOException
- Thrown by Java I/O
ClassNotFoundException
- Thrown by Java I/O
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |